Skip to main content
Scheduler.wait - timers/promises - Node documentation
property Scheduler.wait
Unstable

Usage in Deno

import { type Scheduler } from "node:timers/promises";

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 calling timersPromises.setTimeout(delay, undefined, options) except that the ref option is not supported.

import { scheduler } from 'node:timers/promises';

await scheduler.wait(1000); // Wait one second before continuing

Type

(
delay?: number,
options?: Pick<TimerOptions, "signal">,
) => Promise<void>