const schedule = require("node-schedule");
 
 
 
 每5分钟执行一次:= */5 * * * *
 
//5分钟查询一次价格变化*  *  *  *  *  *  
schedule.scheduleJob(‘*/5 * * * *‘, () => {
    //todo
});
每几小时执行一次:如果写作      * */2 * * *   发现每分钟都在执行
正确写法       0 */2 * * *
//每两小时重新监测一次
schedule.scheduleJob(‘0 */2 * * *‘, () => {
    isSms = 0
});
 
nodejs的定时任务node-schedule
原文:https://www.cnblogs.com/hllxy/p/14210158.html