Difference between revisions of "Os.sleep"

From ComputerCraft Wiki
Jump to: navigation, search
(Added the function template.)
Line 1: Line 1:
Causes the computer to sleep for a number of seconds. This is useful in unexpected ways, as if you try to send a pulse of redstone with:
+
{{lowercase}}
 
+
{{Function
rs([side], true)
+
|name=os.sleep
rs([side], false)
+
|args=timeout
 
+
|api=os
nothing will happen, as there are no in-game ticks between such actions.
+
|addon=ComputerCraft
 
+
|desc=Pauses the computer for a number of seconds
Args: (num) seconds.
+
|examples=
 
+
{{Example
In lua there is no int or double its just numbers.
+
|desc=Pause for 3 seconds
 +
|code=os.sleep( 3 )
 +
}}
 +
}}
 +
You can also just use sleep( timeout )

Revision as of 03:08, 12 May 2012


Grid Redstone.png  Function os.sleep
Pauses the computer for a number of 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 )