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 = void
Parameters Jump to heading
optional
Jump to headingdelay: number = 1
The number of milliseconds to wait before fulfilling the promise.
optional
Jump to headingvalue: T
A value with which the promise is fulfilled.
optional
Jump to headingoptions: TimerOptions
Return Type Jump to heading
Promise<T>