Re: How many timers?
- From: "Jim Mack" <jmack@xxxxxxxxxxxxxxx>
- Date: Tue, 22 Aug 2006 11:26:52 -0400
Martin wrote:
I have an app that runs in a real-time environment. Its ability to
respond in a timely manner to various events is critical (mostly data
coming in and going out via WinSockets and a lot of database access).
I currently have 25 different timers running for various purposes
(some running all the time - others being turned on and off as
needed). I have a need to add 40 more timers to this app (20 would be
running constantly - the other 20 would be on only a small % of the
time).
What effect will this many timers have on the responsiveness of the
program? Do timers consume much in the way of resources?
FWIW, I've sort-of figured out a way to do what I need to do with only
2 timers (instead of 40) but I'm having a lot of trouble getting it to
work properly - thus my question.
Neither VB nor Win32 are realtime in the traditional sense, so if it's 'critical' that your app has real-time response you should consider another platform. If near-realtime is close enough, and if you can deal with an occasional missed tick, then VB might do the trick.
I don't think you actually consume system timer resources when you add VB timers to your app -- IIRC, all timers on a form are backed by a single system timer.
For that and other reasons, the usual advice is to use one timer and dispatch different activities based on the current tick count. You're less likely to be affected by a missed tick, for example.
Also be aware that _Timer ticks are not accumulated: if your _Timer sub, or something it dispatches, is still active when another tick comes along, that tick will just be discarded.
--
Jim Mack
MicroDexterity Inc
www.microdexterity.com
.
- Follow-Ups:
- Re: How many timers?
- From: Tom Esh
- Re: How many timers?
- References:
- How many timers?
- From: Martin
- How many timers?
- Prev by Date: Connect to SQL Server 2005 Problem
- Next by Date: Re: Connect to SQL Server 2005 Problem
- Previous by thread: How many timers?
- Next by thread: Re: How many timers?
- Index(es):
Relevant Pages
|