tags:

views:

316

answers:

1

I was wondering if there was a Java 1.4 library that would return a higher precision time value than your trusted Date.getTime() millisecond value, something similar to System.nanoTime() but for a JDK 1.4?

A custom JNI with C++ QueryPerformanceCounter is the only solution, or something like this has been done before and can be reused?

+1  A: 

This has been answered before here.

chotchki
My question is for a JDK 1.4. The answers in that post are for version 1.5 and up.
dpb
The second answer does describe your situation. Also if you read further down there are discussions about why the precision is the way it is.
chotchki
I noticed the link but since it only displays a nice "It works!" message when accessed, I didn’t give it much thought. But I could find it here: http://web.archive.org/web/20071217090324/http://java.dnsalias.com/downloads/gagetimer-1.1.zip. Thanks chotchki.
dpb