[ntp:questions] Re: ntpd and multimedia timers, Win2K, XP

Martin Burnicki martin.burnicki at gmx.de
Thu Jan 27 22:48:48 UTC 2005

Vadim  Zlotnik wrote:

> Martin,
> Does NTP service really relies on multimedia timers ? I'm surprised,
> because QueryPerformanceCounter should give a much more stable and
> precise results.

NTP does not use the Windows multimedia timers. 

In fact, NTP uses the PerformanceCounter to interpolate the Windows system
time between the 10 or 15 millisecond timer tick intervals, in order to
increase the resolution of the Windows system clock.

This is achieved by an extra thread which is being run as close as possible
to each timer tick. The thread reads the standard system time which has
just been updated due to the timer tick event, and the PerformanceCounter
at the tick time. The high resolution time is then the standard system time
at the last recent tick plus an estimate of the fractions of the current
tick interval based on the difference of the PervormanceCounter values.

Unfortunately, it seems that either the system time value which is read at
each tick is wrong, or the thread is being delayed whenever the multimedia
timer resolution is changed from default to the highest resolution. I
haven't found that out, yet.

So NTP is affected by the multimedia timer even though it doesn't use them.

BTW, I've seen this with several multimedia applications, I just used
Quicktime as an examle. If one application has changed the multimedia timer
resolution then running additional multimedia applications doesn't have
additional effect.

Martin Burnicki

Meinberg Funkuhren
Bad Pyrmont

More information about the questions mailing list