sleep
sleep Sleeps for a given number of seconds. seconds can be given in fractional amounts
Use only for short intervals
The sleep function should only be used for short duration intervals e.g. at most a few minutes. Sleep will not work properly if the user closes the application during the sleep interval, since it exeutes on the phone
Format:
sleep(seconds)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| seconds | number | The number of seconds to sleep. |
Examples
alert("Waiting 5 seconds...")
sleep(5)
alert("done waiting")