Skip to main content

Function: sleep()

sleep<T>(ms: number, value?: T, options?: SleepOptions): Promise<T>

Defined in: sleep.ts:22

Sleeps for the specified number of milliseconds. For a synchronous variant, see sleepSync.

Type Parameters​

Type ParameterDefault type
Tundefined

Parameters​

ParameterTypeDescription
msnumberThe number of milliseconds to sleep.
value?TA value with which the promise is fulfilled.
options?SleepOptions-

Returns​

Promise<T>

See​

sleepSync for a synchronous version.