Re: Timer accuracy

From: Kurt Barthelmess (kbarthelmess_at_compuserve.com)
Date: 10/02/03


Date: Thu, 02 Oct 2003 15:46:25 GMT


"Jens Gruschel" <nospam@pegtop.net> wrote:

>My question: Does anyone know about accuracy of Win9x / WinNT?

No version of WIndows will provide an accurate timer "interrupt" under
all conditions. Timers have one of the lowest priorities around and
your results were a function of the idle status of your system.

>What about
>slower machines?

I t is not the speed so much as it is whether Windows is "busy" when
the timer "ticks". If so, that timer has to wait.

>And finally: Can anyone explain why it can be that
>accurate?

Nominally a PC's clock ticks at 55 msec. intervals, or about 1100 a
minute. (Some versions of WIndows tweak that rate up even higher.)
iac, handling one notification for every 100 possible ones gives lots
of room for error.

>I mean, it takes some time to process the WM_TIMER message,
>execute another SetTimer api call etc.

One a timer is set, messages continue to come in unless you disable /
reset the timer. iac, with a 2GHz system, you can easily process an
uncountable (well, several billion<g>) such interrupts a minute.

Good luck.

Kurt



Relevant Pages

  • Re: Need info on Windows Timers
    ... > 1) How exactly Windows executes the timer callback. ... > From the articles I read, ... > timer interrupt. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Hook timer interrupt in Windows CE
    ... Read the technical article "Implementing Rock-Solid Windows CE Timers on ... Windows CE.NET 4.1 Platforms" in MSDN: ... system timer interrupt, and to associate it with our own ISR. ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Do-Nothing WinForm App Using 4 Threads?
    ... Windows CE). ... | refactoring a multi-threaded GUI app at work and want to be sure it's ... I expected a timer to be on its own ... And the event handling from remote objects ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Do-Nothing WinForm App Using 4 Threads?
    ... refactoring a multi-threaded GUI app at work and want to be sure it's ... I created a plain old Windows Form application with a ... I then added a Windows Timer control to the form and updated a label ... Non "Windows Forms Timers" are handled by the Threadpool, more exactly their handlers run on an IO completion thread pulled from the pool. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Dual-core systems - AMD - Windows Vista
    ... recall that NTP on Windows uses some interpolation technique to overcome ... timer granularity, and that the interpolation used a CPU counter. ... Windows Vista. ... Windows Vista differ from Windows XP so as to affect NTP, ...
    (comp.protocols.time.ntp)