Slow/pause code execution

Verified
Added by iNTERFACEWARE

Use util.sleep() to pause code execution for the specified number of milliseconds

Source Code
   -- 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)
Description
Use util.sleep() to pause code execution for the specified number of milliseconds
Usage Details

Use 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.