I am intrigued with the following statement found in the documentation of the System.nanoTime() method in Java:
long t0 = System.nanoTime();
...
long t1 = System.nanoTime();
One should use t1 - t0 < 0
, not t1 < t0
, because of the possibility of numerical overflow.
Source: http://docs.oracle.com/javase/7/docs/api/java/lang/System.html#nanoTime()
Why is it that t1 < t0
might "overflow"? This is in the Javadocs, but I guess it applies to any language.