Difference between revisions of "Os.sleep"

From ComputerCraft Wiki
Jump to: navigation, search
m (Moved to CAT:LuaCoreFunctions)
m (Updated references from "os" to "OS")
Line 3: Line 3:
 
|name=os.sleep
 
|name=os.sleep
 
|args=timeout
 
|args=timeout
|api=os
+
|api=OS
 
|addon=ComputerCraft
 
|addon=ComputerCraft
 
|desc=Pauses the computer for a number of seconds. 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.
 
|desc=Pauses the computer for a number of seconds. 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.

Revision as of 14:08, 30 November 2012


Grid Redstone.png  Function os.sleep
Pauses the computer for a number of seconds. 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.sleep(timeout)
Returns nil
Part of ComputerCraft
API OS

Examples

Grid paper.png  Example
Pause for 3 seconds
Code
os.sleep( 3 )


You can also just use sleep( timeout )