codemelted.js Module
    Preparing search index...

    Function async_sleep

    • Will put a currently running async task to sleep for a specified delay in milliseconds.

      Parameters

      • delay: number

        Time is milliseconds to delay the task.

      Returns Promise<void>

      The promise to await on for the delay. A rejected promise represents an API violation.

      // From within an async function, sleep 2 seconds.
      await async_sleep(2000);