This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
RE: GLIBC IA64 HP_TIMING fixes for SMP systems with unsynchronized ITC
- From: "Luck, Tony" <tony dot luck at intel dot com>
- To: "Peter Chubb" <peter at chubb dot wattle dot id dot au>, <davidm at hpl dot hp dot com>
- Cc: "Christoph Lameter" <christoph at lameter dot com>, <libc-alpha at sources dot redhat dot com>, <linux-ia64 at vger dot kernel dot org>, <george at mvista dot com>
- Date: Fri, 4 Jun 2004 15:25:56 -0700
- Subject: RE: GLIBC IA64 HP_TIMING fixes for SMP systems with unsynchronized ITC
>Only problem is that we can get high precision, but unless we can also
>get access to the NTP daemon's parameters, we don't know the accuracy
>of the result.
>
>Dunno about your systems, but mine drift around the real time by a
>couple of *milliseconds* so nanosecond accuracy in gettimeofday()
>won't buy much.
It depends what you are trying to do. If you want to time how long
a short event takes ... then asking for the time of day before and
after and subtracting is the obvious solution. If the event only
takes 5 micro-seconds, a one micro-second granularity in gettimeofday()
will give a +/- 20% error. Even if the absolute time you see in the
two calls is off from UTC by a couple of milli-seconds, the rate of
drift is presumably small enough for the subtraction to make sense.
-Tony