System.nanoTime() returns the value of time, the granularity of which is nanosecond; those. 10 -9 seconds as described in javadoc . The difference between the two System.nanoTime() calls, which make up a significant fraction of a second, is limited to a large number.
If you need a time measure with more granularity, consider System.currentTimeMillis() ... or just divide the nanosecond values ββby the appropriate power of 10 according to your application.
Please note that on the Android platform there are 3 different system clock cycles that support different βmeasuresβ of time; see SystemClock . If you are programming explicitly for the Android platform, you should read javadoc and decide which measure is most suitable for what you are doing.
For your information, βnano-β is one of the standard prefixes defined by the International System of Units (SI) - see http://physics.nist.gov/cuu/Units/prefixes.html .
If you really think that βtheyβ were wrong and that βnanoβ is too small, you can always write a letter to NIST. I'm sure someone will appreciate this ... :-)
Stephen c
source share