Skip to main content

Function: sleep()

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

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

Type parameters

Type parameterValue
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.

Source

lib/sleep.ts:22