Function sleep

  • This is a wrapper around setTimeout() that works with await.

    await sleep(100);

    Parameters

    • ms: number

      How long in milliseconds to sleep.

    Returns Promise<unknown>

    A promise that you can wait on.