View Single Post
Old 09-13-2005, 08:33 PM   #7 (permalink)
Dilbert1234567
Devils Cabana Boy
 
Dilbert1234567's Avatar
 
Location: Central Coast CA
Quote:
Originally Posted by Robaggio
System.currentTimeMillis() is bugged on Windows systems. At any point it can be inaccurate by 0-20 milliseconds- more if under heavy load or while running on an Athlon 64(this is a seperate bug though) The bug has been documented but not fixed completely. Part of Sun's solution was to include a higher resolution timer in the release of Java 1.5: System.nanoTime()

This is actually a repackage of a debug timer used internally by a few Sun packages, but it works great nonetheless.

If you're still getting erratic results try executing the code using the server VM.
I tried the nano seconds method, and still, I have the same result.

How do I execute using the server VM ?
__________________
Donate Blood!

"Love is not finding the perfect person, but learning to see an imperfect person perfectly." -Sam Keen
Dilbert1234567 is offline  
 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73