[concurrency-interest] Clock at micro and nano second precision

David Holmes dholmes@dltech.com.au
Thu, 14 Nov 2002 06:36:11 +1000


> Is there a way to get micro or nano second time the
> way java.lang.Clock is doing without waiting for  the
> new JDK?  Or is this something that has to be built
> into the JVM?

It is up to the VM to export this functionality and presently there is
no API to do this. You would have to resort to native code and make a
direct system call.

Note that the Clock API doesn't require nanosecond or microsecond
accuracy, only precision (I think I got that the right way around) -
the implementation could simply return System.currentTimeMillis()
multiplied by the appropriate amount.

David Holmes