[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MirageOS-devel] Timestamp representation and CLOCK



<delurk>

Hi,

Sorry to butt in on a discussion half-way through, but:

At 00:01 +0100 on 12 Jul (1436659292), Daniel Bünzli wrote:
> module type CLOCK = sig
> 
>   val now_d_ps : unit -> int * int64
>   (** [now_d_ps ()] is [(d, ps)] representing the time occuring at
>       [d] * 86'400e12 + [ps] picoseconds from the epoch 1970-01-01
>       00:00:00 UTC. [ps] is in the range \[[0];[86_399_999_999_999_999L]\]. *)

UTC leap seconds make this confusing.  I.e. 'd' is not exactly the
number of (UTC) days since the epoch, but it will _inevitably_ be used
for that, leading to glitches around midnight.

I think if you're going to have a two-part timestamp anyway it would
be better to pick a break point with no semantics.  E.g. 2^56
picoseconds is about the same size as a day, won't be so easily
mistaken for one, and will make some of the calculations more
efficient.

Cheers,

Tim.

<enlurk>

_______________________________________________
MirageOS-devel mailing list
MirageOS-devel@xxxxxxxxxxxxxxxxxxxx
http://lists.xenproject.org/cgi-bin/mailman/listinfo/mirageos-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.