AndyK
April 9th, 2001, 12:51 AM
I have a code that I use to pause for given amount of time:
Sub Pause(interval)
Dim Current as Double
Current = Timer
Do While Timer - Current < Val(interval)
DoEvents
Loop
End Sub
Well, everything works perfect but the Do...Loop structure is CPU consuming and while the structure is executed, CPU is overloaded. I tried to use Sleep API, it works fine in my case also but when Sleep is executed, program is "frozen" so I can't control my program while Sleep API is executing. I was wondering if everyone knows any other way to "simulate" Pause of the program, but so it won't freeze my program and/or won't overload my CPU (Sleep API doesn't overload my CPU, so I was wondering if there's anyway to "unfreeze" my program while Sleep API is executing...just like DoEvents does in Loops)
Programs and requests for them for FREE.
http://falstok.fly.to
Sub Pause(interval)
Dim Current as Double
Current = Timer
Do While Timer - Current < Val(interval)
DoEvents
Loop
End Sub
Well, everything works perfect but the Do...Loop structure is CPU consuming and while the structure is executed, CPU is overloaded. I tried to use Sleep API, it works fine in my case also but when Sleep is executed, program is "frozen" so I can't control my program while Sleep API is executing. I was wondering if everyone knows any other way to "simulate" Pause of the program, but so it won't freeze my program and/or won't overload my CPU (Sleep API doesn't overload my CPU, so I was wondering if there's anyway to "unfreeze" my program while Sleep API is executing...just like DoEvents does in Loops)
Programs and requests for them for FREE.
http://falstok.fly.to