Delay, Pause, Wait or Sleep in VB

Use SetWaitableTimer:

Instead of lNumberOfSeconds As Long, I use lNumberOfSeconds As Double. So I can use 0.3 second (300 milliseconds).

Using Sleep:

Using DoEvents and Timer:

Start another program using Shell and wait until it finishes:

How to pause and restart a thread :


Get every new post delivered to your Inbox.

Join 69 other followers