Re: do pop up boxes stop all events?
- From: "tadamsmar@xxxxxxxxx" <tadamsmar@xxxxxxxxx>
- Date: Wed, 19 Sep 2007 13:43:44 -0700
On Sep 19, 3:46 pm, dpb <n...@xxxxxxx> wrote:
Jim Mack wrote:
dpb wrote:
The Timer will fire on a 100 Hz schedule, within the uncertainty of
Windows, but events may become "stacked up" if there is a bunch of
other activity as, say, from a user switching applications or using
a complex UI to update graphics or somesuch while data acq is going
on in the background.
It's a common misconception that Timer events 'stack up'. They don't.
Any Timer event that occurs while a prior event is being serviced is
lost, not deferred. Do as little as possible in the actual Timer event
to avoid lost ones.
While 100 Hz isn't that high, it's still usually better, if events are
critical, to use the Timer event to just set a flag or bump a counter
and exit. Meanwhile a tight loop with DoEvents does the actual work,
clearing the flag or decrementing the counter as it handles the tasks.
OK, been too long since I used VB for any critical servicing more than
the 1 Hz sorta' thing where would never be an issue -- was thinking it
did add to a queue, but didn't look it up -- thanks for fixing up after
me... :)
It's certainly ideal to keep the Timer routine short as possible. Just
depends on what is actually the level of activity required as to whether
might just go ahead and service the event from the Timer routine or not.
If only set the global or add to a queue, still the overall work has
to be only a fraction of the timer interval or will run into missing
events so the loss of system responsiveness to the UI is the other
performance issue.
(And I know you know that, just adding to hopefully OP's erudition...)
--- Hide quoted text -
- Show quoted text -
I have my app working with a timer in a third form that pushes data
out two the other two forms. Thanks for all the help!
that a 10 ms interval timer does not try to maintain a 100 hertzFrom some experiments, I found that timers are not really reliable in
rate. I think it just gets requeued 10 ms after it runs, or something
like that.
You can show this in a simple test app
in Load:
cnt = Timer()*1000 'Number of milliseconds since mignight
Text1.Text = 0
And in the timer event:
cnt = cnt + Timer1.Interval
Text1.Text = clng (cnt - Timer()*1000)
Text1 will show an increasing negative value. You might have to
performance stress your box a little if its fast, and keep the timer
interval small.
Anyway it was easy to work around this for me.
.
- Follow-Ups:
- Re: do pop up boxes stop all events?
- From: Mike Williams
- Re: do pop up boxes stop all events?
- References:
- VB5: do pop up boxes stop all events?
- From: tadamsmar@xxxxxxxxx
- Re: do pop up boxes stop all events?
- From: Mike Williams
- Re: do pop up boxes stop all events?
- From: tadamsmar@xxxxxxxxx
- Re: do pop up boxes stop all events?
- From: Mike Williams
- Re: do pop up boxes stop all events?
- From: tadamsmar@xxxxxxxxx
- Re: do pop up boxes stop all events?
- From: Mike Williams
- Re: do pop up boxes stop all events?
- From: tadamsmar@xxxxxxxxx
- Re: do pop up boxes stop all events?
- From: tadamsmar@xxxxxxxxx
- Re: do pop up boxes stop all events?
- From: dpb
- Re: do pop up boxes stop all events?
- From: Jim Mack
- Re: do pop up boxes stop all events?
- From: dpb
- VB5: do pop up boxes stop all events?
- Prev by Date: VB.NET
- Next by Date: Re: VB.NET
- Previous by thread: Re: do pop up boxes stop all events?
- Next by thread: Re: do pop up boxes stop all events?
- Index(es):
Relevant Pages
|
Loading