You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Every 10 second regardless of time
new CronJob('10 * * * * *', function () {
console.log('You will see this message every 10 second');
}, null, true, 'America/Los_Angeles');
But after 3 mins I got
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
But I was expecting after first minute :
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
and expecting after second minute :
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
and expecting after third minute :
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
This test for every 5 seconds
new CronJob('5 * * * * *', function () {
console.log('You will see this message every 5 second');
}, null, true, 'America/Los_Angeles');
You will see this message every 5 second appeared 45 seconds later instead of 5 seconds???
So only this works, for every second
new CronJob('* * * * * *', function () {
console.log('You will see this message every second');
}, null, true, 'America/Los_Angeles');
The text was updated successfully, but these errors were encountered:
What @fetherolfjd said is true. Also, rather than printing "see this in 10 seconds" you should print new Date().toString() to get a much more accurate picture of when the onTick is firing.
var CronJob = require('cron').CronJob;
// Every 10 second regardless of time
new CronJob('10 * * * * *', function () {
console.log('You will see this message every 10 second');
}, null, true, 'America/Los_Angeles');
But after 3 mins I got
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
But I was expecting after first minute :
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
and expecting after second minute :
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
and expecting after third minute :
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
You will see this message every 10 second
This test for every 5 seconds
new CronJob('5 * * * * *', function () {
console.log('You will see this message every 5 second');
}, null, true, 'America/Los_Angeles');
You will see this message every 5 second appeared 45 seconds later instead of 5 seconds???
So only this works, for every second
new CronJob('* * * * * *', function () {
console.log('You will see this message every second');
}, null, true, 'America/Los_Angeles');
The text was updated successfully, but these errors were encountered: