File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Precision on System current time Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Precision on System current time" Watch "Precision on System current time" New topic
Author

Precision on System current time

Leandro Melo
Ranch Hand

Joined: Mar 27, 2004
Posts: 401
Hi,
can anyone tell me of what kinda precision we're talking about when using


Suppose, i get a piece of code that takes 1500 milliseconds from a measurement done with the above method.

What can i say for sure about this measurement? For example: between 1600 and 1400 ms, or between 1550 and 1450 ms, etc...

Thanks,
ltcmelo
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24166
    
  30

Depends entirely on what the OS provides.


[Jess in Action][AskingGoodQuestions]
John Smith
Ranch Hand

Joined: Oct 08, 2001
Posts: 2937
To extend a bit EFH's comment, it's about 50ms in Windows 98, 16ms (I think) on WinNT, and 1 ms on Linux. Try this on your system:
John Smith
Ranch Hand

Joined: Oct 08, 2001
Posts: 2937
Wow, I see empty lines in my posted code now. Good job on fixing that UBB bug, Jim Yingst!
Leandro Melo
Ranch Hand

Joined: Mar 27, 2004
Posts: 401
Great!
I tought i could get some good measurments.
My system precision is around 15 ms and the time i'm measuring around 20 :-(
(need to migrate from xp to linux)

Thanks for your help guys,
ltcmelo
 
Don't get me started about those stupid light bulbs.
 
subject: Precision on System current time
 
Similar Threads
code complication
Measurements and significant figures
Some questions about Java SE 7 OCA and OCP
Single & double Precision
Why my program works fine when i write Thread.sleep(0)