I'm building a small simulation game using HTML, PHP, AJAX, MySQL.
I've got it all designed except one issue I can't solve.
I want the simulation to change month every 5 mins (configurable). At each interval a series of 'services' are called. This will update my simulation with all the relevant events.
Initially I thought, I'll do a set Timer internal in JS. Easy but if the page refreshes for any reason then the timer starts again.
I thought, when I update the current interval I could do a 'Next Interval' timestamp. I could then check every 5 seconds if the current timestamp is greater than the next interval stamp and if so true 'true' but this seems like hard work and a lot of extra load on the server with a heap more extra AJAX calls.
Can I get some thoughts on how to solve this please?