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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to