os.cancelTimer

From ComputerCraft
Jump to navigation Jump to search

os.cancelTimer
Function
Syntax
os.cancelTimer()
Returns nil
API os
Source CC:Tweaked (source)

Stops a timer.

The Timer event will not be fired when the timer finishes after calling this function.

You can start a timer with os.startTimer.

ExampleExampleStarts and stops a timer.
Starts a Timer with 5 seconds, then stops it after 3 seconds.
Code
local Id = os.startTimer(5)
sleep(3)
os.cancelTimer(Id)