[ntp:questions] Leap second to be introduced in June

Jochen Bern Jochen.Bern at LINworks.de
Mon Jan 12 16:44:53 UTC 2015

On 01/12/2015 04:55 PM, William Unruh wrote:
> So, there are a bunch of proposals.
> 1. stop the clock a la Mills (delivering times that always increase
>    but very very slowly during that second). 
> 2. double the rate of the clock during the two seconds around the
>    leap. Have the clock run in TAI and put the leapsecond handling
>    into the conversion code. 
> 3. Make the clock run faster, but not twice as fast, during a period
>    around the leap second.
> Are any of these the right thing? 

Yes, #1. The others are wrong because you need the computer clock to run
*slower* (getting stopped being the extreme) to emulate a leap second. ;-)

The fact of the matter is that (typical) computer clocks want to emulate
a leap-second-ful timescale (UTC or a local timezone) with counters that
do not possess the extra states/values to represent leap seconds
(largely due to the fact that the points where they will be inserted are
unpredictable). The only way to *truly* "get things right" is to move
the entire leap second handling into the conversion routines and leave
the low-level counters tick away in peace (just like atomic clocks
provide TAI and the conversion to UTC is done outside them).

Of course, there's a penalty (much higher complexity in the conversions,
need to always have the list of past leap seconds at hand) to be paid
for that. On the other hand, things like correctly determining the time
that passed between two time_t's (or whatever equivalent) would suddenly
return to being a simple subtraction.

Anything that leaves the job of adapting to leap seconds to the counters
themselves will be cursed with either a not-strictly-monotonous time, a
period of outright wrong clock readings around the leap, conversion
routines that effectively are even *more* complex than the ones to "get
it right", or a combination of the above.

								J. Bern
*NEU* - NEC IT-Infrastruktur-Produkte im <http://www.linworks-shop.de/>:
Server--Storage--Virtualisierung--Management SW--Passion for Performance
Jochen Bern, Systemingenieur --- LINworks GmbH <http://www.LINworks.de/>
Postfach 100121, 64201 Darmstadt | Robert-Koch-Str. 9, 64331 Weiterstadt
PGP (1024D/4096g) FP = D18B 41B1 16C0 11BA 7F8C DCF7 E1D5 FAF4 444E 1C27
Tel. +49 6151 9067-231, Zentr. -0, Fax -299 - Amtsg. Darmstadt HRB 85202
Unternehmenssitz Weiterstadt, Geschäftsführer Metin Dogan, Oliver Michel

More information about the questions mailing list