Options
All
  • Public
  • Public/Protected
  • All
Menu

Timer Class.

setTimeout + extra features ( re-starting, pausing, resuming ).

Hierarchy

  • Timer

Index

Constructors

  • new Timer(callback: (() => void), time: number): Timer
  • Constructor for Timer Class

    Parameters

    • callback: (() => void)

      Function to execute when timer is up.

        • (): void
        • Returns void

    • time: number

      Total time to wait before execution.

    Returns Timer

Properties

callback: (() => void)

Type declaration

    • (): void
    • Callback to be executed once timer finishes.

      Returns void

destroyed: boolean

Boolean for checking if Timer is destroyed or not.

paused: boolean

Boolean for checking if Timer is paused or not.

time_left: number

Total time left.

time_start: number

Seconds time when it is started.

time_total: number

Total time given by user [ Used only for re-using timer. ]

timer: Timer

setTimeout function

Methods

  • destroy(): void
  • pause(): boolean
  • resume(): boolean
  • reuse(): boolean

Generated using TypeDoc