Skip to content

Timer

The Timer is a non-visual element that can be used to perform actions at specific intervals.

Extends: BaseElement

Properties

PropertyTypeDefaultDescription
intervalnumber1The interval in seconds at which the timer will trigger its action.
actionfunctionfunctionThe action to be performed when the timer triggers.
runningbooleanfalseIndicates whether the timer is currently running or not.
amountnumber-1The amount of time the timer should run.

Functions

MethodReturnsDescription
Timer:startTimerStarts the timer
Timer:stopTimerStops the timer

Timer:start(self)

Starts the timer with the specified interval.

Parameters

  • self Timer The Timer instance to start

Returns

  • Timer self The Timer instance

Timer:stop(self)

Stops the timer if it is currently running.

Parameters

  • self Timer The Timer instance to stop

Returns

  • Timer self The Timer instance

Released under the MIT License.