Creates a cancellable delay that resolves after the specified duration. Useful for adding pauses in async workflows.
The delay duration in milliseconds
Optional
Cancellable configuration options
A cancellable handle that resolves after the delay
await delay(1000); // Wait 1 second Copy
await delay(1000); // Wait 1 second
const handle = delay(5000);// Cancel the delay earlyhandle.cancel(); Copy
const handle = delay(5000);// Cancel the delay earlyhandle.cancel();
Creates a cancellable delay that resolves after the specified duration. Useful for adding pauses in async workflows.