Subject: Re: microtime
To: David Laight <david@l8s.co.uk>
From: Jonathan Stone <jonathan@DSG.Stanford.EDU>
List: tech-kern
Date: 08/21/2002 16:25:06
>Dangerous, it starts getting possible for nanosecond counts to
>wrap 64 bit integers. 1 sec ~= 2^30 nanoseconds, so that would be
>about 1000 years - ok until you start summing times across the
>processes on a 1000+ cpu system, or want to keep time since
>a sensible epoch.

There's this thing called a "struct timespec", and code which folds
multiples of 2^9 nanoseconds into a separate second field, when
timespecs are added or subtracted.



>If you are actually trying to measure the execution time of
>short code fragments (as opposed to process execution times)
>the raw counts from the fastest counter you have are
>probably best - without any attenpt to scale them to match
>reality.

Yes, of course (until perhaps one presents them to a human), but
isn't that rather a novice-level elementary point?  I do it day in
and day out.  I wouldn't have considered it appropriate for
this venue, myself.

Should I revise my estimate of the technical savvy of tech-kern?