I m working on a TV player on raspberry pi/raspbian
The player part work, my playlist work too, but I m stuck at this:
I get the playlist with a start date (parsing is ok), but I have no idea how I could do to replace the previous playlist by the new one at the scheduled date.
Is there a way to start a function only at a specified time without eating all the cpu by a false "wait"?
I was wondering about setTimeOut function, but is there better way than this?
Take a look at node-cron. It will make a call to your callback at the specified cron time. Take a look at some sample code:
var cronJob = require('cron').CronJob;
new cronJob('00 30 11 * * 1-5', function(){
// Runs every weekday (Monday through Friday)
// at 11:30:00 AM. It does not run on Saturday
// or Sunday.
console.log('Hello');
}, null, true, "America/Los_Angeles");