|  Developer
Updated on November 23, 2021

cancel

  • Cancels a timer previously established by calling set_timeout or set_interval. Passing an invalid ID to cancel() silently does nothing; no exception is thrown.
Edit
Edit
fields type description
timer_id string The identifier of the timer desired to cancel
Edit
fields type description
none
Edit
				
					-- some_module.lua

local timer = require("timer")

local timer_id = timer.set_interval(1000, "HUB:handler", { arg_name = "arg_value" })				
			
				
					-- handler.lua

params = ...

local timer = require("timer")

print(params.arg_name)

timer.cancel(params.timerId)