且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

每五分钟安排一次 Node.js 作业

更新时间:2023-02-22 10:49:03

var minutes = 5, the_interval = minutes * 60 * 1000;
setInterval(function() {
  console.log("I am doing my 5 minutes check");
  // do your stuff here
}, the_interval);

将该代码保存为 node_regular_job.js 并运行它:)

Save that code as node_regular_job.js and run it :)