Simple async task scheduler with catch-up for long running tasks
If you want something to run every 10s and it takes a few seconds.
const createScheduler = require('skeddy');
const scheduler = createScheduler();
scheduler.add(function () {
return new Promise(resolve => {
console.log(Date.now(), 'I still run approx every 3 seconds.')
setTimeout(resolve, Math.random() * 3000)
})
}, 3000);