Java System.nanoTime() huge difference in elapsed time
问题 I'm in and android widget and checking elapsed time between two calls of System.nanoTime() and the number is huge. How do you measure elapsed time with this? it should be a fraaction of a second and instead its much more. Thanks 回答1: The System.nanoTime() returns a time value whose granularity is a nanosecond; i.e. 10 -9 seconds, as described in the javadoc. The difference between two calls to System.nanoTime() that are a substantial fraction of a second apart is bound to be a large number.