Sleep Procedure

Suspends the thread for specified time interval.

Syntax

Sleep ( lMilliSeconds )

The Sleep procedure syntax has the following parts:

 

Name

Type

Description

lMilliSeconds

Val Long

A number specifying the number of milliseconds to suspend the thread.

Comments

Calling Sleep for a thread that displays user interface should be only be done for shorter periods of time. Suspending a thread will cause the thread window to appear not responsive, windows for suspended thread will not redrawn and no interrupts or events is send to the thread. Use the Delay procedure if you like the window and events to still be dispatched to your thread.  

Example

The following example will suspend the current thread for 700 milliseconds:

Sleep(700)

See Also

Delay, DoEvents, ResumeThread, SuspendThread, WaitForEvent