function setTimeout
Jump to headingsetTimeout<T = void>(): Promise<T>import {
setTimeout,
} from 'node:timers/promises';
const res = await setTimeout(100, 'result');
console.log(res); // Prints 'result'
Type Parameters Jump to heading
Jump to headingT = voidParameters Jump to heading
optional
Jump to headingdelay: number = 1The number of milliseconds to wait before fulfilling the promise.
optional
Jump to headingvalue: TA value with which the promise is fulfilled.
optional
Jump to headingoptions: TimerOptionsReturn Type Jump to heading
Promise<T>