utils.new_timer
local timer = utils.new_timer(100, function()print("This will be printed every 100ms")end)timer:start()
Usage:
Begins the timer.
timer:stop()
Pauses the timer.
local timer = utils.new_timer(100, function()print("This will be printed once")end)timer:run_once()
Run a timer once.
local timer_active = timer:is_active()
Returns:
Valuearrow-up-right
Datatypearrow-up-right
timer's state
boolean
local timer = utils.new_timer(0, function()print("This will be run every 1000ms")end)timer:set_delay(1000)timer:start()
Parameterarrow-up-right
Descriptionarrow-up-right
delay
number
the amount of ms to change the timer's delay to
Last updated 3 years ago