Re: Waitable timer accuracy
From: William DePalo [MVP VC++] (willd.no.spam_at_mvps.org)
Date: 04/20/04
- Next message: Dean Roddey: "Re: Having problems with device notifications"
- Previous message: David Lowndes: "Re: FileSystem Problem"
- In reply to: Revelation: "Waitable timer accuracy"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 19 Apr 2004 20:34:08 -0400
"Revelation" <anonymous@discussions.microsoft.com> wrote in message
news:33B59E91-91D8-4B4A-BC94-6B5A8D3A0CEA@microsoft.com...
> After much frustration I tracked down the cause to
> be the waitable timer losing accuracy. When working normally,
> the timer is able to produce delays down to 1 millisecond, but
> when the behaviour starts to get eratic it appears that the timers
> minimum delay drops to 1 hundreth of a second. Now I know that
> the documentation states the accuracy of the timer is system
> dependant, but my system is clearly capable of 1ms delays when
> it chooses.
Excluding the CE variants, no operating system on which Win32 runs can be
classified as "real-time" with hard guarantees as to responsiveness and
latency. Could the behavior you see not be due to the timer per se but
rather what all else is happening contemporaneously in the system?
That said, I think that it is wise to bracket stretches of code - (perhaps
the whole application) - between calls to
timeBeginPeriod(1);
and
timeEndPeriod(1);
Then you may want to consider goosing the priority of the thread(s) that
need(s) the most precise timer.
Next, it would be hard to make definitive statements about where the bottle
neck(s) lie(s) so you probably need to find a good profiler. I think Intel
may have one but I don't have any experience with it.
Finally, wondering aloud, "is it the GC who is doing you in?" :-)
Regards,
Will
- Next message: Dean Roddey: "Re: Having problems with device notifications"
- Previous message: David Lowndes: "Re: FileSystem Problem"
- In reply to: Revelation: "Waitable timer accuracy"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|