os.startTimer
From ComputerCraft Wiki
Revision as of 19:53, 19 December 2013 by Bomb Bloke (Talk | contribs) (Link to the event this function triggers.)
| Adds a timer which will fire a "timer" event once after time seconds have passed. It returns an int which acts as a unique ID for the timer. Fractions of a second are supported, but only down to a game tick, or 1/20 of a second (0.05s). Times are rounded up to the next tick, so os.sleep(1.01) and os.sleep(1.05) both wait for 1.05 seconds. | |
| Syntax | os.startTimer(number time) |
| Returns | number timerID |
| Part of | ComputerCraft |
| API | OS |
Examples
| Yields until 3 seconds have passed. | |
| Code |
local myTimer = os.startTimer(3) |