|
-
Apr 2nd, 2000, 11:41 PM
#1
Thread Starter
Frenzied Member
Hi!
I'm using the following code to make a timer fucntion:
code:
PauseTime = 1
Start = Timer
Do While Timer < Start + PauseTime
DoEvents
Loop
Finish = Timer
TotalTime = Start - Finish
It works fine, but i want to be able to change the Interval (PauseTime)
I have tried:
SaveSetting "Timer" , "Timer" , "Timer" , "0.05"
Dim Interval
Interval = GetSetting("Timer" , "Timer" , "Timer")
PauseTime = Interval
Start = Timer
Do While Timer < Start + PauseTime
DoEvents
Loop
Finish = Timer
TotalTime = Start - Finish
But instead of an interval on 0.05 sec. , the interval is 5 secs!!
What is wrong???
-
Apr 2nd, 2000, 11:53 PM
#2
You can create a sub routine which will except one parameter that will tell it the interval:
Code:
Public Sub TimeOut(pInterval As Single)
Dim sngTimer As Single
sngTimer = Timer
Do While Timer < sngTimer + pInterval
DoEvents
Loop
End Sub
Then you can call it like:
TimeOut 3
This will pause for 3 seconds.
-
Apr 3rd, 2000, 07:21 AM
#3
Fanatic Member
If you using a timer control then the timer interval is measured in milliseconds, thast 1000 milliseconds per second, so:
1 second is 1000 therfore
timer1.interval=1000
and 0.5 seconds is 500 therefore
timer1.interval=500
and .05 seconds is 50 therefore
timer1.interval = 50
Savvy?
{;->
DocZaf
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
|