View Single Post
  #1 (permalink)  
Old 02-26-2008, 08:26 PM
Stellaferox Stellaferox is offline
Basic4ppc Veteran
 
Join Date: Apr 2007
Posts: 200
Default How to use timer to clock speed of subs?

Hi,

I want a very simple timer to clock the speed in several subs in order to tune up the speed of the application.
Is this enough?

Sub Globals
N = 10
STOP = FALSE
End Sub

Sub App_Start
Form1.Show
Timer1.Interval = 1 'minimum milliseconds
Timer1.Enabled = True
End Sub

Sub Something
STOP = FALSE

Do the thing.....

STOP = FALSE
End Sub

Sub Timer1_Tick
N = N+1
If STOP = FALSE Then Timer1.Enabled = False
lblTime.Text = N
End Sub

thnx
Marc

Last edited by Stellaferox : 02-26-2008 at 08:29 PM.
Reply With Quote