[time-nuts] End Of The World

Martin Burnicki martin.burnicki at burnicki.net
Thu Jul 2 05:50:58 EDT 2015


Frister wrote:
> My NTP server did a double 59 on the terminal. for anybody who is interested
> I captured the event :
> https://youtu.be/OpNci29CI7E

I think you need to be careful if you just watch the time in a loop with 
a "sleep 1". Due to slightly varying sleep intervals the time when the 
"date" command is called may interfere with the second boundary of the 
system time, so you may observe missing or duplicate times anyway.

Eventually the following command shows less ambiguous results:

while true; do date -u +'%F %T.%N'; sleep 0.25; done

E.g.:

2015-07-02 09:46:01.236101917
2015-07-02 09:46:01.490039978
2015-07-02 09:46:01.743952328
2015-07-02 09:46:01.997539363
2015-07-02 09:46:02.251356539
2015-07-02 09:46:02.505238060
2015-07-02 09:46:02.759204117
2015-07-02 09:46:03.013218510
2015-07-02 09:46:03.267194076
2015-07-02 09:46:03.521256275
2015-07-02 09:46:03.775118487
2015-07-02 09:46:04.029012022
2015-07-02 09:46:04.283006237
2015-07-02 09:46:04.537024946
2015-07-02 09:46:04.790874099

Usually you get 4 timestamps per second, but eventually there may be 
only 3 or so, depending on the accuracy of the sleep intervals. In any 
case you have the fractions of the second to *see* that there is 
eventually a second :03.999999999 where you expected :04.000000000, or 
vice versa.

Martin




More information about the time-nuts mailing list