Code
Loading editor...
Tap Analyze to see visualization
Click Analyze to visualize
See step-by-step execution, variables, and output
Variables
Run code to see variables
Output
Console output will appear here
Click Analyze to visualize
See step-by-step execution, variables, and output
Run code to see variables
Console output will appear here
Return a Promise that resolves after a setTimeout of the specified duration. This allows pausing async functions with await. Combine with a retry loop and exponential backoff to add resilience to network requests.
Wrapping setTimeout in a Promise converts a callback-based timer into an awaitable expression, enabling clean sequential delays in async/await code without nesting callbacks.
Updated Mar 2026