goldies
    Preparing search index...

    Function sleep

    • Pause the execution of code for a specified duration.

      Parameters

      • ms: number

        The number of milliseconds to pause the execution.

      Returns Promise<void>

      A Promise that resolves after the specified duration.

      async function example() {
      console.log('Start');
      await sleep(1000);
      console.log('After 1 second');
      }