Loop for X seconds then exit
I just want to set up a Do-Loop that exits after a certain number of seconds
have elapsed. The following code does not work, but I think you will get the
idea. This does not need to be that precise, just approximate.
Could someone please correct my code to work or post some other example code
that does run? Something like:
Dim dTimeBeg as Date
Dim dTimeEnd as Date
Dim lElapsed as Long
lElapsedSeconds = 49 <<<<<<<<<this would be seconds I specify
dTimeBeg = Now()
Do
dTimeEnd = Now()
If dTimeEnd = dTimeBeg + lElapsedSeconds then Exit Do
Loop
Thanks much in advance.
|