Delays for a given number of milliseconds
A promise that resolves when the delay is over
AbortError if the operation was aborted
await delay(1000)
const ac = new AbortController()await delay(1000, ac.signal)ac.abort()
The number of milliseconds to delay
Optional
The !AbortSignal to listen to for abort events
Generated using TypeDoc
Delays for a given number of milliseconds
Returns
A promise that resolves when the delay is over
Throws
AbortError if the operation was aborted
Example
Example