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

  1. The interval is 10, and enabled is set to true.

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.