@vgerbot/async
    Preparing search index...

    Function delay

    • Creates a cancellable delay that resolves after the specified duration. Useful for adding pauses in async workflows.

      Parameters

      • ms: number

        The delay duration in milliseconds

      • Optionaloptions: CancellableOptions<void>

        Cancellable configuration options

      Returns CancellableHandle<void>

      A cancellable handle that resolves after the delay

      await delay(1000); // Wait 1 second
      
      const handle = delay(5000);
      // Cancel the delay early
      handle.cancel();