diff --git a/doc/api/timers.md b/doc/api/timers.md index 89f9ad312e33c4..cfbc8f1ead4b71 100644 --- a/doc/api/timers.md +++ b/doc/api/timers.md @@ -170,25 +170,7 @@ next event loop iteration. If `callback` is not a function, a [`TypeError`][] will be thrown. This method has a custom variant for promises that is available using -[`util.promisify()`][]: - -```js -const util = require('util'); -const setImmediatePromise = util.promisify(setImmediate); - -setImmediatePromise('foobar').then((value) => { - // value === 'foobar' (passing values is optional) - // This is executed after all I/O callbacks. -}); - -// Or with async function -async function timerExample() { - console.log('Before I/O callbacks'); - await setImmediatePromise(); - console.log('After I/O callbacks'); -} -timerExample(); -``` +[`timersPromises.setImmediate()`][]. ### `setInterval(callback[, delay[, ...args]])`