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

Re: micro second timestamps from a regression test progrsm

On 16 Nov 2011, at 12:09, Haris Rotsos wrote:

> I found something at OS.Clock.time() (unit -> float). This I think
> binds back to the libc gettimeofday.

On the UNIX side, a good general piece of advice for accurate time-keeping is 
to use clock_gettime() and name a high-accuracy clock. You can also use 
clock_getres() to ask questions about the resolution of the timestamps you get 
back. On FreeBSD, at least, you can request accurate vs. fast using different 
clock names. Finally, asking for the time of day is not quite the same as 
asking for elapsed time, so you might or might not be interested in asking for 
a monotonic time source instead of a time-of-day time source, depending on your 
goals and how NTP feels.




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