Re: Timer not being time-true

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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


.



Relevant Pages

  • Re: How to Convert 8bit into 6bit AIS encapsulation?
    ... I would suggest the more optimal method would use a look-up table opposed ... The timer event is queued such that it can be delayed for a number ... event would be missed entirely (never enter the queue). ... A slower machine is going process data slower. ...
    (microsoft.public.vb.general.discussion)
  • Question about DoEvents
    ... it also has a method that adds an item to the queue ... sub additem ... and control is going to the timer event (If the timer event fires at ...
    (microsoft.public.vb.general.discussion)
  • Re: Time outs and state machines
    ... The ACK message gets put on the queue and immediately after the ... I was thinking about giving each timer event a unique ID as ... connection to is reset to bring all parties into a definite state. ...
    (comp.object)
  • Re: Question about DoEvents
    ... If the queue is processing, it will accept additional queue items, and will ... doevents in the addItem method, it made me think that the doevents fired ... just as the timer event was firing to check for additional items (which it ... I wonder if perhaps the doevents in the addToQueue sub in the server is ...
    (microsoft.public.vb.general.discussion)
  • Re: List box selection and requery
    ... Why not do away with the timer event and instead requery the listbox ... >must be performed on the selection they choose. ... I need to be sure that the deselection only ...
    (microsoft.public.access.formscoding)