WishMeLz

生活其实很有趣

NodeJs定时任务

const schedule = require("node-schedule");
let j = schedule.scheduleJob('50 * * * * *', function(){
    console.log('1');
});

//取消 
// j.cancel()

比如实现监控网站运行状况:https://github.com/WishMelz/NodeJsSetInterval

var later = require('later');
var basic = {h:[9],m:[41]};
var composite=[
    basic
];
var sched={
    schedules:composite
};
later.date.localTime();
var t=later.setInterval(function(){
    console.log("---11----");
},sched);