Class Support.Interval
The Interval class is a utility class that is capable of executing a given function at a specified interval.
It uses the World of Warcraft API ticker in the background to mimic the setInterval() function in JavaScript. And different from other support classes, Interval is an instance based class, which means it requires one instance per interval, allowing multiple intervals to be run at the same time.
Methods
support.interval:setCallback (value) | Sets the callback to be executed at each interval. |
support.interval:setSeconds (value) | Sets the number of seconds between each interval. |
support.interval:start () | Starts the interval. |
support.interval:startImmediately () | Executes the callback immediately and starts the interval. |
support.interval:stop () | Stops the interval if it's running. |
Metamethods
support.interval:__construct () | Interval constructor. |
Methods
- support.interval:setCallback (value)
-
Sets the callback to be executed at each interval.
Parameters:
- value function the callback to be executed at each interval
Returns:
-
Support.Interval
self
- support.interval:setSeconds (value)
-
Sets the number of seconds between each interval.
Parameters:
- value integer the number of seconds between each interval
Returns:
-
Support.Interval
self
- support.interval:start ()
-
Starts the interval.
Returns:
-
Support.Interval
self
- support.interval:startImmediately ()
-
Executes the callback immediately and starts the interval.
Returns:
-
Support.Interval
self
See also:
- support.interval:stop ()
-
Stops the interval if it's running.
Returns:
-
Support.Interval
self