import {
setTimeout,
} from 'node:timers/promises';
const res = await setTimeout(100, 'result');
console.log(res); // Prints 'result'
function
timers.promises.setTimeout
delay?: number,
value?: T,
): Promise<T>;
@param delay
The number of milliseconds to wait before fulfilling the promise. Default: 1
.
@param value
A value with which the promise is fulfilled.