function promisedTimeout(miliseconds) { return new Promise((resolve, reject) => { setTimeout(() => { resolve(); }, miliseconds) }) } promisedTimeout(1000) .then(() => { console.log('1 second passed!'); });