神岛 API 文档 - ArenaPro版
    Preparing search index...
    • Parameters

      • handler: TimerHandler
      • Optionaltimeout: number
      • ...arguments: any[]

      Returns number

    • Parameters

      Returns number

      用于延迟执行函数的计时器,delayMs毫秒后异步执行回调函数callback。 该函数自身是同步的,返回用于清除此计时器的ID,可在 clearTimeout 中使用。

      A timer for delaying the execution of a function. The callback function is executed asynchronously after delayMs milliseconds. This function itself is synchronous and returns an ID that can be used in clearTimeout to clear the timer.

      要延迟执行的回调函数。

      The callback function to be executed with a delay.

      延迟的毫秒数。

      The delay in milliseconds.

      用于清除计时器的ID。

      The ID for clearing the timer.

    • Parameters

      Returns number

      用于延迟执行函数的计时器,delayMs 毫秒后异步执行回调函数 callback

      A timer for delayed execution of a function. Asynchronously executes the callback function callback after delayMs milliseconds.

      要延迟执行的回调函数。

      The callback function to be executed with a delay.

      延迟的毫秒数。

      The delay in milliseconds.

      用于清除计时器的 ID。

      The ID used to clear the timer.

    • Schedules execution of a one-time callback after delay milliseconds.

      The callback will likely not be invoked in precisely delay milliseconds. Node.js makes no guarantees about the exact timing of when callbacks will fire, nor of their ordering. The callback will be called as close as possible to the time specified.

      When delay is larger than 2147483647 or less than 1 or NaN, the delay will be set to 1. Non-integer delays are truncated to an integer.

      If callback is not a function, a TypeError will be thrown.

      This method has a custom variant for promises that is available using timersPromises.setTimeout().

      Type Parameters

      • TArgs extends any[]

      Parameters

      • callback: (...args: TArgs) => void

        The function to call when the timer elapses.

      • Optionaldelay: number

        The number of milliseconds to wait before calling the callback. Default: 1.

      • ...args: TArgs

        Optional arguments to pass when the callback is called.

      Returns Timeout

      for use with clearTimeout()

      v0.0.1

    • Parameters

      • callback: (_: void) => void
      • Optionaldelay: number

      Returns Timeout