function setTimeout
#setTimeout<T = void>(): Promise<T>import {
setTimeout,
} from 'node:timers/promises';
const res = await setTimeout(100, 'result');
console.log(res); // Prints 'result'
Type Parameters #
#T = void Parameters #
#delay: number optional
The number of milliseconds to wait before fulfilling the
promise. Default: 1.
#options: TimerOptions optional
Return Type #
Promise<T>