Helpful
    Preparing search index...

    Halts the current thread to invoke an event loop.

    The total number of milliseconds to sleep.

    The type of value that will be resolved.

    A promise that resolves with val after ms milliseconds.

    • Halts the current thread to invoke an event loop.

      Parameters

      • Optionalms: number

        The total number of milliseconds to sleep.

      Returns Promise<void>

      A promise that resolves after ms milliseconds.

    • Halts the current thread to invoke an event loop.

      Type Parameters

      • T

        The type of value that will be resolved.

      Parameters

      • ms: number

        The total number of milliseconds to sleep.

      • val: T

        The value to resolve with.

      Returns Promise<T>

      A promise that resolves with val after ms milliseconds.