News for hackers. Stuff that matters.
Re:Determine durations with monotonic clocks if available by bjackman on Monday January 30, 2023 @04:33AM (#34577633)
Fun fact: because Google's data centres have _basically_ monotonic CLOCK_REALTIME due to smearing leap seconds over 24h, the open-source abseil.io relies on it.

So you can't use absl if you need your time logic to be correct and also work in non-smearing environments, or in environments where the RTC isn't guaranteed to always be well-synced.

Re:Determine durations with monotonic clocks if available by amelius on Monday January 30, 2023 @06:28AM (#34578403)
I bet most systems could get away with just suspending services during a leap second.
Re:Determine durations with monotonic clocks if available by actionfromafar on Monday January 30, 2023 @08:20AM (#34579211)
You have to remember and/or code in a downtime during leap seconds. That may be the bigger challenge.
Re:Determine durations with monotonic clocks if available by amelius on Monday January 30, 2023 @02:56PM (#34585497)
Well, I'd be ok with the OS suspending all running processes for a short time.

With a special API for folks who don't want that.

So everything works, unless you want to squeeze the last bit of performance from the machine, in which case you would have to do extra work.

Aka, correctness first, then comes performance.