Wrapper class for window.setTimeout().

Hierarchy

  • Timer

Constructors

Accessors

Methods

Constructors

  • Parameters

    • pHandler: (() => void)
        • (): void
        • Returns void

    Returns Timer

Accessors

  • get isRunning(): boolean
  • true if timer was started

    Returns boolean

Methods

  • Starts the timer. The handler will be executed only once if consecutive calls are made before the timeout.

    Parameters

    • pTimeout: number

      Timeout in milliseconds for the timer.

    • pRestart: boolean = false

      If true and the timer is currently running, the timer will be restartet with the new timeout. If false the currently running timer will stay active and the new timeout is ignored. (default: false)

    Returns void

  • stops the timmer if it is currently running

    Returns void

Generated using TypeDoc