JSR 166 will contain a class TimeUnit which encapsulates the mind-numbing complexity of multiplication by a power of ten . It will also potentially enable fast processors to measure extremely small time intervals in microseconds or nanoseconds, but it won't give the actual solar date and time in nanoseconds. If your goal is to determine how much time has elapsed rather then to obtain the actual system time, you can wait until Java 1.5 comes out an use code that looks something like this:
Joined: Jan 07, 2003
So there is no way I can measure elapsed time in microseconds as things stand now!!!
Thanks for the info. It saves me hours trying to find the right code. Maybe I will try and use Native interface to c.
Even if the processor you are running on has a real time clock accurate in micro- or nano- seconds, the standard C library calls probably will not give that to you. If so, use JNI to call C, and in C call an Assembler program to get current clock values. In any case, you will never get more accurate than the processor's RTC. Regards, Guy