[ntp:questions] ntpd wedged again

David J Taylor david-taylor at blueyonder.co.uk.invalid
Sat Feb 11 08:28:45 UTC 2012


"Terje Mathisen" <> wrote in message news:tekh09-1ro.ln1 at ntp6.tmsw.no...
[]
> Have you tried to time the minimum clock reading time with RDTSC or 
> GetPerformance* counter calls?
>
> I wrote a tiny test program on my Win7-64 laptop, it got:
>
> Reading the system clock 10000000 times, minimum reading time = 24 clock 
> cycles,
>  minimum OS step = 0 ticks, maximum OS step = 10000 ticks
>
> The clock frequency is 2.7 GHz or so, the FileTime ticks should be 100 
> ns each, so my OS clock is making 1 ms steps, while the clock reading 
> time is down to less than 10 ns!
[]
> Terje
> -- 
> - <Terje.Mathisen at tmsw.no>
> "almost all programming can be viewed as an exercise in caching"

I wrote a similar test program some time back, and it's available for 
download here:

  http://www.satsignal.eu/software/net.htm#PCClockTiming

You can see from the screen-shot that QueryPerformanceCounter took ~200 ns 
on an older XP system with an Intel processor, and ~2 us on a Vista PC 
with an AMD processor.  I didn't time GetSystemTimeAsFileTime, but I could 
add that if it's needed.

Cheers,
David 



More information about the questions mailing list