Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Does an enabled Timer control use a lot of system resources ?

Status
Not open for further replies.

hiptino

Programmer
May 27, 2000
18
0
0
NG
Does an enabled Timer control use a lot of system resources?
 
Not really. But prove it to yourself. Start SYSMON and let it run. Place a timer and a textbox on a form. Set the interval on the timer to 1 (1 millisecond) and set the index property to 0. Place this code in the timer and run it.
[tt]
Private Sub Timer1_Timer(Index As Integer)
On Error Resume Next
If Val(Text1) < Index Then Text1 = Index
Load Timer1(Index + 1)
DoEvents
End Sub
[/tt]

This will create multiple instances of the timer. The count in the text box will show you how many timers are running at the same time.

I just tried it. Loaded more than 200 timers before processor usage hit 100% and had 795 timers loaded before Windows said &quot;That's enough.&quot; The machine didn't crash. Windows just decided it didn't want to load any more timers.
VCA.gif

Alt255@Vorpalcom.Intranets.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top