Slow/pause code execution
Use util.sleep() to pause code execution for the specified number of milliseconds
-- pause code for 0.1 seconds util.sleep(100) -- pause code for 1 seconds util.sleep(1000) -- pause code for 5 seconds util.sleep(5000)
util.sleep() to pause code execution for the specified number of milliseconds. This can be useful for throttling performance during peak hours, pausing between retrying slow/intermittent resources, or perhaps for simulating heavy loads during testing.
How to use the snippet:
- Paste the code into your script
Note: We supply modules specifically for retrying and throttling, see the links below.