@mojojs/core
    Preparing search index...

    Variable sleepConst

    sleep: <T = void>(
        delay?: number,
        value?: T,
        options?: TimerOptions,
    ) => Promise<T> = setTimeout

    Sleep asynchronously.

    Type Declaration

      • <T = void>(delay?: number, value?: T, options?: TimerOptions): Promise<T>
      • import {
        setTimeout,
        } from 'node:timers/promises';

        const res = await setTimeout(100, 'result');

        console.log(res); // Prints 'result'

        Type Parameters

        • T = void

        Parameters

        • Optionaldelay: number

          The number of milliseconds to wait before fulfilling the promise. Default: 1.

        • Optionalvalue: T

          A value with which the promise is fulfilled.

        • Optionaloptions: TimerOptions

        Returns Promise<T>

        v15.0.0