News for hackers. Stuff that matters.
Re:A positive leap second will be introduced at the end of J... by cnvogel on Monday January 05, 2015 @03:15PM (#8840847)
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....

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....

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.

There are no comments on this comment yet.