timer event

From ComputerCraft
Jump to: navigation, search
timer
Event
Returns
  • timer : number unique timer number

Source CC:Tweaked

Occurs when a previously set timer has elapsed.

ExampleExampleUsing the Timer event
Sets a timer at 5 seconds, then waits for it to finish.
Code
local myTimer = os.startTimer(5)
local event, timerNumber
while timerNumber ~= myTimer do
  event, timerNumber = os.pullEvent("timer")
end
print("A timer has finished!")