Skip to: Site menu | Main content

Login

Name: 
Password:
Remember me?
Register

Creating a Simple Delay

written by Mark Rowlinson - Last updated May 2005

Add the following API declare to the declarations section of your code module:

 
Private Declare Sub Sleep Lib "kernel32" Alias "Sleep" (ByVal dwMilliseconds As Long) 
 

Now simply call it in your code using:
 
 'Wait 2 seconds
Sleep 2000& 
 

The only argument is the number of milliseconds to wait for.