2 ms·
Workload 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 c
by cnvogel 12y ago
Workload 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.