Re: Timer not being time-true
- From: "Michel Walsh" <vanderghast@VirusAreFunnierThanSpam>
- Date: Mon, 9 May 2005 15:51:37 -0400
Hi,
Windows works by sending message on a queue. When the processor got time, it
pumps a message and executes it... unless this is a Painting message or a
Timer message. A paint/timer message is only executed if there is not other
type of messages in the queue. So, on a very slow (busy) machine, the timer
event may miss a firing (or two)... We say they are low priority messages.
They are definitively not guaranteed to fire. It is preferable to ASK to
fire the event each x millisecond and, inside the timer event procedure, to
check against the reported clock time, not against the total number of time
the event fired. As example, if you write a game, and the event fire, you
look at the time, and then, compute where a given component (car, or
otherwise moving object) should be at THAT time... So, if the PC "freezes"
for a moment of two, when it comes back, your game is still "in synch" with
the other players. If you would have based your logic on the number of
frames you rendered (ie, based on the number of time the event fired), you
would then always be lagging by one of two frames-time... not desirable.
Hoping it may help,
Vanderghast, Access MVP
"DianePDavies" <DianePDavies@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:2924811A-9162-402B-B23B-394EDCD63D95@xxxxxxxxxxxxxxxx
>I have a form that requeries data every 20 seconds based on a timer event.
>
> When doing that I display the requery time as well - and I can see that
> sometimes the requery intervals are longer than 20 secons - sometimes as
> long
> as 60 seconds.
>
> How is that?
>
> Is the Timer Interval really not a time, but a "cycle count" - and general
> load on the PC can affect this?
> --
> Diane
.
- Follow-Ups:
- Re: Timer not being time-true
- From: DianePDavies
- Re: Timer not being time-true
- Prev by Date: Re: Passing variables to Function problems
- Next by Date: Re: Custom Message When Record is Locked
- Previous by thread: Filter List Box
- Next by thread: Re: Timer not being time-true
- Index(es):
Relevant Pages
|