News for hackers. Stuff that matters.
Re:2038: Only 21 years away by antirez on Tuesday March 21, 2017 @05:55PM (#13926624)
Pardon, it's billion indeed if you count seconds. I wrote millions for mistake, but thinking about it once you have 64 bits, milliseconds are nice to have...
Re:2038: Only 21 years away by ekimekim on Tuesday March 21, 2017 @09:22PM (#13927829)
But once you have milliseconds, microseconds are nice to have...

The linux kernel (and many other applications) solve this with a tuple of 64-bit ints (seconds, nanoseconds) where 0 <= nanoseconds <= 999999999. Compare this to simply 64 bits of nanoseconds, which would run out in roughly 2554 CE.

Other systems still (perhaps most commonly) are using double floats for seconds. Under that scheme, nanoseconds were only representable until Feb 17th 1970. The last representable microsecond will be some time in 2106, and the last representable second won't be for another 150 million years or so.

Personally, I'm happy with the precision afforded by floats. Timing uncertainly (outside niche applications) is generally much larger than a single nanosecond, and even microseconds are a bit suspect.

Re:2038: Only 21 years away by tdhoot on Tuesday March 21, 2017 @10:57PM (#13928170)
Why not just use int32 for nanoseconds then?
Re:2038: Only 21 years away by Dylan16807 on Wednesday March 22, 2017 @06:22AM (#13929763)
The nanoseconds field in timespec is actually a long, for some reason. I have no idea why it's not fixed-size.

Let's not even get into timeval which uses the same size field for microseconds.