Difference between revisions of "Lua:sleep"
Jump to navigation
Jump to search
(Created page with ''''function''' sleep(''Delay'') Pauses the thread this lua script executes in for the given amount of milliseconds. (1000 milliseconds=1 second) ===Function Parameters=== {|wi…') |
|||
(10 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
+ | [[Category:Lua]] | ||
'''function''' sleep(''Delay'') | '''function''' sleep(''Delay'') | ||
Pauses the thread this lua script executes in for the given amount of milliseconds. (1000 milliseconds=1 second) | Pauses the thread this lua script executes in for the given amount of milliseconds. (1000 milliseconds=1 second) | ||
+ | |||
+ | Note: Executing this from the main thread(gui) will make the gui stop responding for the given time (Buttons can not be clicked) | ||
Line 14: | Line 17: | ||
|The time to wait in milliseconds (1000=1 second) | |The time to wait in milliseconds (1000=1 second) | ||
|} | |} | ||
+ | |||
+ | Example: Sleep(1000) -- This will pause the execution of current thread for 1 second. | ||
− | + | {{LuaSeeAlso}} | |
− |
Latest revision as of 00:13, 25 January 2018
function sleep(Delay)
Pauses the thread this lua script executes in for the given amount of milliseconds. (1000 milliseconds=1 second)
Note: Executing this from the main thread(gui) will make the gui stop responding for the given time (Buttons can not be clicked)
Function Parameters[edit]
Parameter | Type | Description |
---|---|---|
Delay | Integer | The time to wait in milliseconds (1000=1 second) |
Example: Sleep(1000) -- This will pause the execution of current thread for 1 second.