interface
timers.promises.Scheduler
interface Scheduler
- wait(delay: number,): Promise<void>;
An experimental API defined by the Scheduling APIs draft specification being developed as a standard Web Platform API.
Calling
timersPromises.scheduler.wait(delay, options)is roughly equivalent to callingtimersPromises.setTimeout(delay, undefined, options)except that therefoption is not supported.import { scheduler } from 'node:timers/promises'; await scheduler.wait(1000); // Wait one second before continuing@param delayThe number of milliseconds to wait before resolving the promise.
An experimental API defined by the Scheduling APIs draft specification being developed as a standard Web Platform API.
Calling
timersPromises.scheduler.yield()is equivalent to callingtimersPromises.setImmediate()with no arguments.