Subject: Re: Problem with clock_gettime()
To: None <email@example.com>
From: None <wolfgang+gnus20031124T054217@dailyplanet.dontspam.wsrcc.com>
Date: 11/24/2003 05:52:45
firstname.lastname@example.org (Ian McIntosh) writes:
> When doing this I have noticed some strange behaviour
> with clock_gettime(). I can call clock_gettime() and
> store the result in a temporary variable and then
> when I call it again the time returned is before
> the time in the temporary variable (indicating that
> time has gone backwards????).
This is an old problem. PR 14100 (and probably others)
As an aside, if you need to measure delay-time you probably want to
use the TSC if you have one in your processor. You get much finer
granularity time in units of your processor's internal clock speed.
(eg. 3.2 Ghz clock ticks on a 3.2Ghz CPU.)
/* x86 stub for reading the CPU's tick counter */
typedef unsigned long long u64;
Wolfgang S. Rupprecht http://www.wsrcc.com/wolfgang/
The above "From:" address is valid. Don't mess with it.