function sleep(time){ return new Promise(function(resovle){ console.log(+new Date()) setTimeout(resovle,time) }) } sleep(1000).then(function(){ console.log(+new Date()) })