R
fn

sleep

v0.0.3tested

Delays the execution of the current function by the specified amount of time

Examples

ts
await sleep(1000);
ts
sleep(1000).then(() => {
 console.log('Hello, World!');
});

Signature

ts
export function sleep(ms: number): Promise<void>{ ... }

Parameters

ParameterTypeDescription
msnumberThe amount of time to delay the execution of the current function

Returns

Promise<void>- A promise that resolves after the specified amount of time