Quick easy question about pausing in a prog

hugohugo37

Member
Joined
May 9, 2006
Messages
8
Programming Experience
Beginner
I can't seem to find a simple answer to this very simple question-

I just want to put a type of pause command into a for next loop so that it pauses for, say, five seconds between iterations.

The example given for the timer class was really convoluted. There must be a one or two line way to do this.

Thanks for your help.
 
not sure if this is what you want:

VB.NET:
            '5sec
            Dim timeOut As DateTime = Now.AddMilliseconds(5000)
            Do
                Application.DoEvents()
             'Keep looping until the elasped time of 5000 milliseconds.
            Loop Until Now > timeOut

HTH
 
Last edited:
VB.NET:
threading.thread.sleep(5000) ' 5000 milliseconds = 5 seconds
Nice suggestion, but don't do this in UI thread!
 
Back
Top