Constructor
new Timer(actionPerformed, interval, enabledopt)
Timer constructor
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
actionPerformed | function | The function to be triggered when the timer is enabled. | ||
interval | number | The interval between action calls, specified in milliseconds. | ||
enabled | boolean | <optional> | false | Flag to indicate if the timer will be initially enabled. |
Members
interval :number
The timer interval, in milliseconds
- number
repeats :boolean
When true
, the timer should repeat until stop
is called
- boolean
ticks :number
The ticks counter
- number
timer :object
The object returned by window.setInterval
- object
Methods
actionPerformed(_thisTimer)
Here is where subclasses must define the function to be performed when this timer ticks.
Name | Type | Description |
---|---|---|
_thisTimer | module:AWT. |
isRunning() → {boolean}
Checks if this timer is running
- Type:
- boolean
processTimer(_event)
This is the method called by window.setInterval
Name | Type | Description |
---|---|---|
_event | external:Event |
setEnabled(enabled, retainCounteropt)
Enables or disables this timer
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
enabled | boolean | Indicates if the timer should be enabled or disabled | ||
retainCounter | boolean | <optional> | false | When |
start(retainCounteropt)
Starts this timer
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
retainCounter | boolean | <optional> | false | When |
stop(retainCounteropt)
Stops this timer
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
retainCounter | boolean | <optional> | false | When |