Sleep: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
Sleep milliseconds | ''This function is for BASIC compatibility. It is not available in pure JavaScript projects.'' | ||
Sleep ''milliseconds'' | |||
== Description == | == Description == | ||
Sleep pauses execution of the program for a period of time equal to milliseconds. The program does not yield the event loop: execution will continue on the next statement. | Sleep pauses execution of the program for a period of time equal to milliseconds. The program does not yield the event loop: execution will continue on the next statement. | ||
== Example == | Use of this statement is discouraged. It puts your app into a hard loop for the time period, which has no good side effects. In most cases, [[SetTimeout|SetTimeOut]]() will be more useful. | ||
== Example (BASIC) == | |||
<pre> | <pre> | ||
Line 14: | Line 18: | ||
[[Category:Language Reference]] | [[Category:Language Reference]] | ||
[[Category:Miscellaneous]] |
Latest revision as of 17:59, 24 March 2019
This function is for BASIC compatibility. It is not available in pure JavaScript projects.
Sleep milliseconds
Description
Sleep pauses execution of the program for a period of time equal to milliseconds. The program does not yield the event loop: execution will continue on the next statement.
Use of this statement is discouraged. It puts your app into a hard loop for the time period, which has no good side effects. In most cases, SetTimeOut() will be more useful.
Example (BASIC)
Rem Sleep Example 'Pause execution for 5 seconds Sleep 5000