- Print
- DarkLight
- PDF
Article summary
Did you find this summary helpful?
Thank you for your feedback
Description
Delays script execution for a specified # of milliseconds.
Tip
1,000 milliseconds = 1 second
Input Parameters
Name | Type | Required | Description |
---|---|---|---|
duration | Number | Yes | Time (in milliseconds) |
Returns
No return value.
Examples
// delay for .25 seconds
debug.delay(250);
// this code runs after delay is complete
...
Remarks
Notice
Delays are intended for testing purposes only and may not work in production environments. Please remove them from all production scripts.
In general, adding delays to your scripts is a bad idea - especially in production. They translate to poor user experiences and costly execution times.
Evidence suggests people are irritated by delays > 250 milliseconds.
Avoid delays completely in production.