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

Re: [nm-wg] standard timestamp format



timestamp intervals are differenced to provide a duration, and A-B needs to be in common units for A and B

Adrian

On Jun 17, 2004, at 1:30 PM, Dan Gunter wrote:


I would suggest that the units be an optional parameter, since they aren't always needed, and maybe aren't always known, i.e. in the case of some kind of hardware clock.
If you don't know the clock frequency then the data is meaningless,
the units should be nanoseconds and you should multiply whatever the
source clock rate is by some implementation and source specific factor to get to nanoseconds. For the simplest portable java code that would
be 1000000 to go from milliseconds. Linux doesn't require a hires counter but I think some implementations may have one, Solaris always
has gethrtime regardless of whether its on SPARC or x86, I know HP-UX, AIX and windows have hires counters.
Not meaningless; if I'm comparing intervals A and B, I don't need any units to say that A/B = 1.5. But I see your point that in general we want to know what the time intervals really represent. So, sure, let's make nanoseconds the standard units. One less piece of metadata to worry about. In cases where the units aren't needed, it might as well be nanoseconds [ignoring issues with misinterpretation, since this is such an edge case anyways].

-Dan

Adrian