Skip to main content

This is documentation for Caché & Ensemble.

For information on converting to InterSystems IRIS, see the InterSystems IRIS Adoption Guide and the InterSystems IRIS In-Place Conversion Guide, both available on the WRC Distributions page (login required).

Previous sectionNext section

Sleep

Causes program execution to delay for the specified number of seconds.

Synopsis

Sleep time

Arguments

time A number specifying the number of seconds to delay. Can be an integer specifying whole seconds, or a decimal number specifying fractional seconds.

Description

The Sleep statement delays program execution for the specified duration in seconds. Program execution then resumes at the statement immediately following Sleep. A non-numeric time value is treated as zero.

Examples

The following example illustrates the use of the Sleep statement with whole seconds:

Println now
Sleep 5
Println now
Copy code to clipboard

The following example illustrates the use of the Sleep statement with fractional seconds:

Println now
Sleep 0.9
Println now
Copy code to clipboard

See Also

  • Basic: Now function, Timer function

  • ObjectScript: HANG command