|
-
August 8th, 2001, 11:44 AM
#1
Sleep/Delay/Pause an application w/o Do loop or Sleep API
Is there a way to pause/delay a process without using a DO loop or Sleep API call?
I'm trying to do it with a timer but haven't had any success.
Let me know if there's anything that can be used for this example, Thanks!!!!
Pros/Cons of using a DO loop:
-makes CPU Usage go up to 100% when waiting/pausing since it's running constantly in the background, but it lets user edit information on the form while it's waiting/pausing.
Pros/Cons of using a Sleep API call:
-stops the application completely when waiting/sleeping, and user cannot edit any information since the application is stopped/frozen. But, it doesn't take up the CPU usage.
Sleep function:
[vbcode]
Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
[\vbcode]
Do loop 1:
[vbcode]
Do
If Current >= TargetTime Then
Exit Do
End If
' allow other processes to run
DoEvents
DoEvents
Loop
[\vbcod]
Do loop 2:
[vbcode]
Do
If StrComp(CurrentTime, TargetTime) = 1 Then
Exit Do
End If
DoEvents
DoEvents
Loop
[\vbcode]
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
|