commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jörg Schaible <Joerg.Schai...@Elsag-Solutions.com>
Subject RE: Gump & VM
Date Thu, 15 Dec 2005 08:53:00 GMT
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


Mime
View raw message