commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin van den Bemt <mll...@mvdb.net>
Subject Re: Gump & VM
Date Thu, 15 Dec 2005 09:15:00 GMT
Does a Thread.sleep(1) or something similar maybe help ?

Mvgr,
Martin

Jörg Schaible wrote:
> C. Grobmeier wrote on Thursday, December 15, 2005 9:46 AM:
> 
> 
>> > So what can we do?
>>
>>I read about timers in the book "killer game programming in java" :-),
>>where this things are important. Maybe this is a direction for you.
>>
>>Use the following instead of System.currentTimeMillis():
>>
>>1) Suns undocumented Class (Java2): sun.misc.Perf
> 
> 
> Non-portable
> 
> 
>>2) Java 5: System.nanoTime()
> 
> 
> Not JDK 1.3 compatible as the rest of the classes in id
> 
> 
>>This two have a higher resolution than currentTimeMillis()
>>and could help.
> 
> 
> And I doubt that it will help if the OS (or an appropriate daemon task) is manipulating
the system clock. The problem is not too *less* resolution, it is too *much* - at least with
daemons adjusting system time smoothly. Descreasing the resolution means, that the code might
not be affected if such a daemon shifts the system time by some millis into the past.
> 
> - Jörg
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message