|
-
August 24th, 2001, 07:40 AM
#1
timers
i wanna to know how much it will take to do some loop....how can i put a timer for it?
-
August 24th, 2001, 09:07 AM
#2
Re: timers
You need to start the timer when the loop starts and end the timer when the loop stops and record it into a label control. I don't know how accurate you want to be but if you want it to be to the second then set the interval on the timer to 1000 and set the timers enabled property to false then...
Do while a <> b
timer1.enabled = true
loop
and under the timer put...
dim time, add
add = 1
time = label1.caption
label1.caption = time + add
* don't forget to make label1.caption = "0" before you start the timer. *
hope I could help. If you want to make it more accurate there is a topicon the forum that goes into further detail on timers.
-
August 24th, 2001, 10:15 AM
#3
Re: timers
Dim dS As Date 'start
Dim dF As Date 'finish
Dim vE As Variant'elapsed time
dS = Now()
dF = Now()
vE = Format$(dF - dS, "hh:mm:ss")
MsgBox vE
Iouri Boutchkine
[email protected]
-
August 25th, 2001, 02:34 PM
#4
Re: timers
in a module declare
public Declare Function GetTickCount Lib "kernel32" () as Long
(or in a form)
private Declare Function GetTickCount Lib "kernel32" () as Long
and then in your sub do
Dim t as Long
...
t = GetTickCount
Do While a < 10000
...
Loop
t = GetTickCount - t 'This is in Milliseconds
----------
The @host is everywhere!
----------
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|