Re: [ROOT] system time in msec ?

From: Robert Hatcher (rhatcher@SLAC.stanford.edu)
Date: Tue Mar 05 2002 - 23:50:32 MET


On Tue, 5 Mar 2002, Juergen Hannappel wrote:

> > after all this discussion, don't you think its a good idea to add msec to
> > TDatime (and its now() ctor) ?
>
> if a finer Grain is added, add nsecs. They fit as well into 32 bits as
> usecs and even if now they are not filled to their possible prcision
> it might come sooner than expected...

<sigh> I agree, and this is exactly what TTimeStamp does.... it adds
a ns member.  It also uses POSIX standard t=0 "epoch" start (Jan 1,
1970) rather than Jan 1, 1995 (TDatime).

The question is how to *fill* the sub-second portion via system
routines.  Via user specified values isn't a problem -- lots of
options are given there including passing in a timespec struct and
explicitly specifying the various components.  The problem is that
while there are widely implemented POSIX standard means of retrieving
the system clock's seconds since "epoch", there aren't standard ways
that are implemented on all platforms for getting the sub-second parts.

-robert

Robert W. Hatcher   | rhatcher@fnal.gov   630-840-3102
FNAL CD/CP (MINOS)  | MS 220, PO Box 500, Batavia IL 60510



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:44 MET