• Sleeps for the specified number of milliseconds.

    Parameters

    • ms: number

      The number of milliseconds to sleep.

    Returns Promise<void>

    A promise that resolves after the specified time.

    Example

    async function main() {
    console.log('Start');
    await sleep(2000); // Sleep for 2 seconds
    console.log('End'); // Printed after sleep
    }
    main();

Generated using TypeDoc