Function sleep

Await this to pause execution until the duration has passed.

  • Parameters

    • durationMs: number

      The duration in ms until the sleep in over

    Returns Promise<void>

    console.log(Date.now()) // 1725739228744

    await sleep(1000);

    console.log(Date.now()) // 1725739229744