|
-
Nov 26th, 1999, 07:29 AM
#1
Without using timer control, what would be the best way to delay execution of code?
I would like to pause the program for about 1/10 of second before executing th. I could just use For loop to run for, say, 100K times, but I would rather use a function call or so.
Thanx.
SK
-
Nov 26th, 1999, 01:24 PM
#2
This will do it:
Code:
Dim dblEndTime As Double
dblEndTime = Timer + 0.5
Do While dblEndTime > Timer
' Do nothing but allow other
' applications to process
' their events.
DoEvents
Loop
------------------
Marty
-
Nov 26th, 1999, 02:05 PM
#3
There is also the Sleep API which will pause your Apps Processes for a Given number of Milliseconds..
Code:
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Sub Command1_Click()
Caption = "Ready.."
Sleep 100 'Pause for 1/10 of a Sec.
Caption = "Go!!!"
End Sub
------------------
Aaron Young
Analyst Programmer
[email protected]
[email protected]
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
|