enabled
Topic group Related topics Example
Specifies whether a Timer object is active and counting down time.
Property of
Timer
Description
Set the enabled property to true to activate the Timer object. When the number of seconds of idle time specified in the interval property has passed, the timer’s onTimer event fires.
When the enabled property is set to false, the Timer stops counting time and the internal counter is reset. For example, suppose that
The interval is 10, and enabled is set to true.
Then 9 seconds of idle time go by, and
enabled is set to false.
If the enabled property is set to true again, the onTimer event will fire after another 10 seconds has gone by, even though there was only 1 second left before the timer was disabled.
If a Timer is intended to go off only once, instead of repeatedly, set the enabled property to false in the onTimer event handler.