[190600] in North American Network Operators' Group
Re: Leap Second planned for 2016
daemon@ATHENA.MIT.EDU (Jimmy Hess)
Sun Jul 10 14:28:52 2016
X-Original-To: nanog@nanog.org
In-Reply-To: <CAAeewD-p8w5M5neGMtT8qkE=2sBNyn2wUWUOqT22+31R_cmUig@mail.gmail.com>
From: Jimmy Hess <mysidia@gmail.com>
Date: Sun, 10 Jul 2016 13:28:29 -0500
To: Saku Ytti <saku@ytti.fi>
Cc: NANOG list <nanog@nanog.org>
Errors-To: nanog-bounces@nanog.org
On Sun, Jul 10, 2016 at 3:27 AM, Saku Ytti <saku@ytti.fi> wrote:
[snip]
> a) use UTC or unix time, and accept that code is broken
[snip]
The Unix time format might be an unsuitable time representation for
applications which require clock precision or time precision within a
few seconds for the purposes of Timestamping or synchronizing events
down to a Per-Second or Subsecond resolution.
Suggest revising Unix/POSIX Time implementation to use a 3-Tuple
representation of calendar time, instead of a single Integer.
typedef int64_t time_t [3];
[ Delta from Epoch in Seconds, Delta in Microseconds,
Cumulative Leap Adjustment from the Epoch in Microseconds]
Thus to compare two timestamps A and B
long long difference_in_seconds(time_t A, time_t B) {
return (B[0] - A[0]) + ( B[1] - A[1] + B[2] - A[2] ) /1000000;
}
--
-JH