5
BlueSky
6d

I love this documentation about System. nanoTime()

Differences in successive calls that span greater than approximately 292 years (2^63 nanoseconds) will not correctly compute elapsed time due to numerical overflow.

Can I confidently say that no service will ever break this limit?

Comments
  • 2
    If we somehow invent 128 bit arch, i don't think so.
  • 1
    Nothing's impossible.
    Toyota.
  • 3
    Has to be documented, otherwise someone will try it using virtual timing and raise a big when it craps out...
  • 4
    We thought the same when we used two digit years.
  • 1
    This is the sort of mindset that caused Y2K. "Oh, two digits is enough for the year!"
  • 1
    292 year before calling it the second time, passing on the knowledge from generation to generation of the importance to never ever let the program crash, hardware fail or electricity run out of this very important challenge to get to see java overflow.
Add Comment