Static
Readonly
awaitStatic
Readonly
safeSafely schedule an async interval, even if the duration is too large. Same as safeSetInterval, but async promises are awaited, after which the next interval is scheduled
The interval to wait between each call
The async function to run after each interval
Optional
onNewTimeout: (timeout: Timeout, isTimeoutForRunFn: boolean) => voidA callback for when a new timeout is scheduled
The interval object
Static
Readonly
safeSafely schedule an interval, even if the duration is too large. Uses safeSetTimeout to recursively schedule timeouts
The interval to wait between each call
The function to run after each interval
Optional
onNewTimeout: (timeout: Timeout, isTimeoutForRunFn: boolean) => voidA callback for when a new timeout is scheduled
The interval object
Static
Readonly
safeSafely schedule a timeout, even if the duration is too large
The number of milliseconds to wait
Whether to schedule the overflow in the future
The function to run after the timeout
Optional
onNewTimeout: (timeout: Timeout, isTimeoutForRunFn: boolean) => voidA callback for when a new timeout is scheduled
The timeout object
Static
Readonly
sleepSleep/wait for a specified amount of time
The number of milliseconds to sleep
A promise that resolves after specified time
Static
Readonly
sleepSleep until a condition is met
The condition to wait for
The interval to check the condition, in milliseconds
A promise that resolves when the condition is met/true
Static
Readonly
sleepSleep until a condition is met or a timeout is reached
The condition to wait for
The maximum time to wait, in milliseconds
The interval to check the condition, in milliseconds
A promise that resolves when the condition is met/true
Wait for a promise to resolve, but only for a specified amount of time