To compare two nanoTime values
long t0 = System.nanoTime();
...
long t1 = System.nanoTime();
one should use
t1 - t0 < 0
, not
t1 < t0
, because of the possibility of numerical overflow.
-
Returns:
- the current value of the running Java Virtual Machine's high-resolution time source, in nanoseconds