title: How to compare two nano time values? [javadoc confusion]
body: <p>I have read the javadoc for <code>System.nanoTime()</code> and it all seems clear. Until I reached the final paragraph:</p>
  <blockquote>
  <p>To compare two nanoTime values</p>
  <p><code>long t0 = System.nanoTime();</code></p>
  <p><code>...</code></p>
  <p><code>long t1 = System.nanoTime();</code></p>
  <p>one should use t1 - t0 &lt; 0, not t1 &lt; t0, because of the possibility of numerical overflow.</p>
  </blockquote>
  <p>There are two things that are unclear to me:</p>
  <ol>
  <li>Why would one check if <code>t1 &lt; t0</code> if <code>t1</code> was taken after <code>t0</code>? My understanding is that nano time is always increasing. So, I would rather check <code>t1 &gt; t0</code>.</li>
  <li>Let's suppose that's a typo, and they meant the correct check is <code>t1 - t0 &gt; 0</code>. I still don't get it why that is the correct way of checking and not <code>t1 &gt; t0</code>. They mention the numerical overflow and I don't quite get what they mean. Regarding the numerical overflow, here's what is mentioned:</li>
  </ol>
  <blockquote>
  <p>Differences in successive calls that span greater than approximately 292 years (2^63 nanoseconds) will not correctly compute elapsed time due to numerical overflow.</p>
  </blockquote>
  <p>OK, so since the nano time is stored as a long value, it will eventually overflow in 292 years. And what happens next? Does it start from the beginning, i.e. the lowest negative value -2^63? Or does it stop measuring and returns (2^63 - 1) always?</p>