4 ms·
How does the system-wide workload of changing from UTC to TAI compare to adding the leap second? No idea about this stuff myself, just curious.
by themodelplumber 12y ago
How does the system-wide workload of changing from UTC to TAI compare to adding the leap second? No idea about this stuff myself, just curious.
- scott_karana 12y agoI think TAI is continuous, unlike UTC, so you can continue auto-incrementing timers without leap seconds and breakages, and just apply the leap-second to rendered time, not accounted time.
- cnvogel 12y agoWorkload is pretty low in either case... Here's the function in the Linux-Kernel that's counting the seconds. It's actually not specified if this function is called exactly every second, or more often, or less often. It just overflows accumulated nanoseconds to seconds: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/kernel/time/timekeeping.c#n1511 https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.... The only leap-second specific thing in it is the function second_overflow() called in the line linked above, it's implementation is linked below. seconds_overflow() checks if a flag updated by NTP which means "there will be a (positive or negative) leap second at the end of today" (bits in time_state) is active, and if that's the case the last second will be repeated, or skipped. https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/kernel/time/ntp.c#n374 https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.... So, computationally, keeping the general complexity of timekeeping in mind, leap second processing is completely insignificant, as evident by the comparatively tiny second_overflow() function.