File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Nano Timer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Nano Timer" Watch "Nano Timer" New topic

Nano Timer

Tom Hill
Ranch Hand

Joined: Aug 24, 2003
Posts: 115
Hi guys, I hope you can help:
Im developing in java 1.4.2 is there a mechanism to get the current time in Nano seconds rather than just milliseconds?
Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

System.nanoTime() - since 1.5. Doesn't sound too reliable though.

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Michael Lloyd Lee

Joined: Sep 07, 2005
Posts: 22
not without JNI or upgrading to 1.5.

Please please please use code tags!<br /> <br /><a href="" target="_blank" rel="nofollow">Java API</a> - <a href="" target="_blank" rel="nofollow">Java Tutorials</a>
I agree. Here's the link:
subject: Nano Timer
It's not a secret anymore!