Difference between revisions of "Os.startTimer"

From ComputerCraft Wiki
Jump to: navigation, search
(Added NeedsWork tag)
(Copypasta from Os.sleep. This text should have been here to begin with.)
Line 7: Line 7:
 
  |returns={{type|number}} timerID
 
  |returns={{type|number}} timerID
 
  |addon=ComputerCraft
 
  |addon=ComputerCraft
  |desc=Adds a timer which will fire a "timer" event once after <var>time</var> seconds have passed. It returns an int which acts as a unique ID for the timer.
+
  |desc=Adds a timer which will fire a "timer" event once after <var>time</var> 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.
 
  |examples=
 
  |examples=
 
}}
 
}}
  
 
[[Category:Lua_Core_Functions]]
 
[[Category:Lua_Core_Functions]]

Revision as of 06:30, 21 July 2013

This page needs some serious TLC, stat!
Please help us by cleaning it, fixing it up, or sparing it some love.
(Reason: This page needs an example)


Grid Redstone.png  Function os.startTimer
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