Creates an instance of Timer.
Newly created timers will be default to be added to the global timerManager. Can manually create TimerManager and assign timers.
The activation status of timer.
Delay in ms before timer starts
Whether this timer is expired and should be removed from timerManager.
Status indicator: whether this timer is ended.
Status indicator: whether this timer is started.
Whether this timer loops forever
The repeat count before timer stop
The time until timer triggered.
The timerManager this timer is assigned to.
The global TimerManager which is default to all newly created timers.
Calls each of the listeners registered for a given event.
Return an array listing the events for which the emitter has registered listeners.
Return the number of listeners listening to a given event.
Return the listeners registered for a given event.
Add a listener for a given event.
Add a one-time listener for a given event.
Remove this timer from it's timerManager.
Return self for chainable method.
Remove all listeners, or those of the specified event.
Remove the listeners of a given event.
Rest timer to it's initial status.
Return self for chainable method.
Start timer from it's current time.
A started
event will be emitted.
Return self for chainable method.
Stop timer, current time stop updated.
A ended
event will be emitted.
Return self for chainable method.
Increment timer's time. Should be put in main logic loop.
Using TimerManager.update()
method instead is recommended.
The amount of increment in ms.
Generated using TypeDoc
A Simple Timer class extending EventEmitter3
Auther: Shen Yiming(soimy@163.com)
Repo: https://github.com/soimy/eventemitter3-timer
Timer
{EventEmitter}