haifa-reminder/node_modules/cron/examples/multiple_jobs.js

16 lines
379 B
JavaScript
Raw Normal View History

2023-07-26 11:01:58 +00:00
const CronJob = require('../lib/cron.js').CronJob;
console.log('Before job instantiation');
const job = new CronJob('*/5 * * * * *', function() {
const d = new Date();
console.log('First:', d);
});
const job2 = new CronJob('*/8 * * * * *', function() {
const d = new Date();
console.log('Second:', d);
});
console.log('After job instantiation');
job.start();
job2.start();