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

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

      Returns number

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

      Parameters

      • callback: Function

        要定时执行的回调函数。

      • delayMs: number

        间隔的毫秒数。

      Returns number

      用于清除计时器的ID。

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

      Parameters

      • callback: Function

        要定时执行的回调函数。

      • delayMs: number

        间隔的毫秒数。

      Returns number

      用于清除计时器的ID。

    • Schedules repeated execution of callback every delay milliseconds.

      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.setInterval().

      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 clearInterval()

      v0.0.1

    • Parameters

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

      Returns Timeout