logoalt Hacker News

netsharcyesterday at 4:15 PM2 repliesview on HN

You make it sound like time labels like "23:59:58Z" can perform actions (e.g. to skip or "suppress").

I had to look it up: https://www.timeanddate.com/time/negative-leap-second.html . In proper words, the clock ("the one humanity agrees to use) would skip 23:59:59Z.

I wonder how much chaos a minute that only has 59 seconds would cause. Measurements would be off by that missing second (e.g. a pipeline delivering fuel at 60 liters/minute would surprisingly only have 59 liters in that minute..).


Replies

waherntoday at 12:02 AM

Nobody should be using an API like time(2) or clock_gettime(2)+CLOCK_REALTIME to measure event durations with sub-second precision or accuracy, especially when controlling mechanical equipment. And I'd be absolutely surprised if anybody was when controlling equipment, at least in a regulated industry.

On unix this is what CLOCK_MONOTONIC is for; for one thing, the real-time clock can be reset at any time. Technically even CLOCK_MONOTONIC could jump forward. Real-time embedded systems either provide other timing APIs, or make additional guarantees about CLOCK_MONOTONIC's behavior.

show 1 reply
throw0101cyesterday at 5:32 PM

> I wonder how much chaos a minute that only has 59 seconds would cause.

The FreeBSD folks test(ed?) their code for these things and it works:

* https://lists.freebsd.org/pipermail/freebsd-stable/2020-Nove...

Of course third-party userland code understanding what happens is another thing.