Delay execution of code for a Number of seconds.
Delay execution of code for a Number of seconds.
Rate Delay execution of code for a Number of seconds.
(1(1 Vote))
Private Sub Timer2_Timer()
Dim DelayTime As Long
Dim EndTime As Long
DelayTime = 22 'Set Delay in Seconds.
EndTime = Format(Time, "s") + DelayTime
If EndTime > 59 Then
'Make sure Seconds is Not Greater than 59.
EndTime = EndTime - 59
End If
Do Until Format(Time, "s") = EndTime
'Yields execution so that the operating system can process other events.
DoEvents
Loop
'Turn Timer Off.
Timer2.Enabled = False
End Sub
Delay execution of code for a Number of seconds. Comments
No comments yet — be the first to post one!
Post a Comment