I have a timestamp stored in a MySQL database, and I want to periodically (say every second), update the difference between the current time and the timestamp value stored on the database (of course without reloading the page) to show something like a 5 minute count-down timer. Right now. I'm thinking use setTimeout to periodically fire an AJAX request that gets this value. Is this the best approach? Instead, should I just run a client-side timer, and then sync it with the server-side timestamp every minute or so?
Note: This timer is responsible for an important function on my website, so it should be reasonably accurate.
Edit: I don't need a cron job, I just need a countdown timer that updates on a webpage like from 5:00 to 4:59 to 4:58... etc, automatically. If you're familiar with the one Megaupload had before it was shutdown, I need something similar.