Interface Timer

interface Timer {
    restart(callbackFn, delay?, time?): void;
    stop(): void;
}

Methods

Methods

  • Restart a timer with the specified callback and optional delay and time. This is equivalent to stopping this timer and creating a new timer with the specified arguments, although this timer retains the original invocation priority.

    Parameters

    • callbackFn: ((elapsed) => void)
        • (elapsed): void
        • Parameters

          • elapsed: number

          Returns void

    • Optional delay: number

      An optional numeric delay in milliseconds (default = 0) relative to time.

    • Optional time: number

      An optional time in milliseconds relative to which the delay is calculated (default = now).

    Returns void

  • Stop the timer.

    Returns void