I'm building a simple nodejs script that updates a DNS record based on my current IP. The script works fine but I have some concerns regarding how should I run it. The check for my IP must be performed every 5 minutes and I'm facing a dilemma.
Should I use Node's setInterval or should I create a cron job? Which will consume the least RAM and CPU? Please keep in mind that the script runs on a Raspberry Pi Zero with 512MB ram and only 1 core.
I know that the cron
seems a better option but how much better is it? Does it matter given my specs?