Re: Windows clock update frequency
- From: "m" <m@xxx>
- Date: Tue, 27 Nov 2007 10:17:57 -0500
Yes but what are you timestamping? I can't think of anything that would
need 1ms precision continuous resolution. If this is a sampling
application, then the results can always be post-processed to account for
clock drift; but you are suggesting that you need to process this data as a
stream.
BTW: you will have to deal with these additional issues:
1) When using NTP, the clock may gap forward or backward. This can
cause an item that was processed later in time than another item to have a
timestamp that is earlier.
2) The resolution of the timestamp you are looking for is on the same
order of magnitude as the time taken to query it, and beneath the size of a
quantum, so your results are inherently unreliable no matter what the clock
resolution
3) The accuracy of the clock may not be improved sufficiently by NTP in
order to obtain sub-second accuracy if the clock skew in a machine is large.
You may also need to run the machines for a long time (days / weeks) to
obtain reliable corrections for the skew.
BTW: it shouldn't surprise you that Windows has limited clock resolution.
Remember that the OS core was written for 386 and similar hardware. I
remember running NT 3.51 on a 16 MHz processor with 16 MB of RAM and
thinking that I had a killer fast system ;)
"Guillaume" <Guillaume@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:AA8B6A28-A9A7-437C-AF60-576BFDD62723@xxxxxxxxxxxxxxxx
It is for timestamping. Tick count has also a drift, which is small at the
beginning, but which is in minutes after several days... That is why we
need
a synchronization with system clock.
But because we also want to synchrnonize 2 servers, we use NTP. And tick
counts do not take into account NTP drift correction. I hope it better
explains why we need that.
Again, I find surprising that the clock update frequency is higher on
Linux
than on Windows.
"m" wrote:
What would you need this for? I am curious because I can't think of
anything that would have this requirement. For a high rate sequence /
timestamp (e.g. while sampling at high frequency), tick count would be
better because it can't go backwards and you can use statistical analysis
to
correlate the tick counts to absolute time; for a regular timestamp, I
can't
see how a resolution of 1 ms would be meaningful.
"Guillaume" <Guillaume@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:966D8334-F927-4C04-8296-734E6DA60A0C@xxxxxxxxxxxxxxxx
Thanks for that. In fact, we have already tried this solution, but it
does
not change a lot of things.
So you confirm that it is not possible on Windows to update the clock
update
frequency? It seems different on Linux, that is why I wonder.
"Tim Roberts" wrote:
Guillaume <Guillaume@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
In fact, I have 2 servers synchronized with NTP, and on each server,
I
need
an accurate time. I cannot rely only on timers, because they are not
impacted
by NTP. So I would like to rely on the absolute time, but with
Windows,
the
accuracy seems to be only 15/16 ms. On Linux, gettimeofday() seems to
have a
1 ms accuracy.
I think you will have to get clever. You could, for example, align
the
cycle counter and the wall clock time every now and then, doing
something
like this:
FILETIME ftmAlign;
LARGE_INTEGER qpcAlign;
void align()
{
FILETIME ftm1, ftm2;
GetSystemTimeAsFileTime( &ftm1 );
while( 1 )
{
GetSystemTimeAsFileTime( &ftm2 );
if( ftm1.dwLowFileTime != ftm2.dwLowFileTime )
break;
}
QueryPerformanceCounter( &qpcAlign );
}
Now, you can call QueryPerformanceCounter, figure the delta between it
and
qpcAlign, and add that to ftmAlign.
--
Tim Roberts, timr@xxxxxxxxx
Providenza & Boekelheide, Inc.
.
- References:
- Re: Windows clock update frequency
- From: Maxim S. Shatskih
- Re: Windows clock update frequency
- From: Don Burn
- Re: Windows clock update frequency
- From: Guillaume
- Re: Windows clock update frequency
- From: Maxim S. Shatskih
- Re: Windows clock update frequency
- From: Guillaume
- Re: Windows clock update frequency
- From: Tim Roberts
- Re: Windows clock update frequency
- From: Tim Roberts
- Re: Windows clock update frequency
- From: Tim Roberts
- Re: Windows clock update frequency
- From: m
- Re: Windows clock update frequency
- From: Guillaume
- Re: Windows clock update frequency
- Prev by Date: Driver installation using "setup & deployment" wizard?
- Next by Date: Re: Driver installation using "setup & deployment" wizard?
- Previous by thread: Re: Windows clock update frequency
- Next by thread: Re: Vista, IM driver, OID_GEN_NETWORK_LAYER_ADDRESSES and IPv6 address
- Index(es):
Relevant Pages
|