I'm using a Waitable Timer Object in the following way:
- Set the timer to an absolute time t0
- when timer wakes up, trigger an action, and set the timer again to an
absolute time t0 + 1 day
(Actually, we take daylight savings time into account; since the Waitable
Timer Object uses UTC for absolute time, we cannot set the timer to wake up
periodically right from the start.)
I have noticed that for the second wake-up time (t +
1 day), the timer typically wakes up 80 to 90 seconds /early/.
Now, I'm perfectly aware that Windows XP is not a real-time OS, but a
deviation of 80 to 90 seconds seems like a lot to me.
Is this behaviour to be expected? Are there any strategies to improve the
Since the deviation seems to be at least loosely proportional to the wakeup
time span, I thought of the following algorithm: Set the next wakeup time
t0 + 1 day - 5 minutes
and set it again to
t0 + 1 day
when the timer wakes up. That way the deviation should become smaller,
because the overall span is only 5 minutes instead of 1 day.
What do you think?