Node.js实战6:定时器,使用timer延迟执行。

setTimeout 在nodejs中,通过setTimeout函数可以达到延迟执行的效果,这个函数也常被称为定时器。 一个简单的例子: console.log( (new Date()).getSeconds() ); setTimeout(function(){ console.log( (new Date()).getSeconds() ); console.log("hello wor
相关文章
相关标签/搜索