import { setTimeout,} from 'node:timers/promises';const res = await setTimeout(100, 'result');console.log(res); // Prints 'result' Copy
import { setTimeout,} from 'node:timers/promises';const res = await setTimeout(100, 'result');console.log(res); // Prints 'result'
Optional
The number of milliseconds to wait before fulfilling the promise. Default: 1.
1
A value with which the promise is fulfilled.
v15.0.0