y***h 发帖数: 4 | 1
For reference only,
copied from Java Developer Connection Forum, written by
knoxos: | d*x 发帖数: 9 | 2 The best I could do was using JNI to invoke the Solaris high resolution
timer. That gave me a resolution of around 30us(the cost mostly being
the JNI overhead and Solaris System call overhead).
On i386 platforms, you can directly get hardware clock from a register.
This register exists on Pentium+ machines, it records every tick of the
CPU. So for a 1GHz box, that is a nanosec resolution timer(well, not
exactly, there will be some overhead in reading the register). This wouldn't
help in Java tho |
|