Hacker News new | ask | show | jobs
by ars 5592 days ago
Instead of:

  window.setInterval(frame, 1000);
Do:

  window.setTimeout('window.setInterval(frame, 1000)', 999-(new Date()).getMilliseconds());
That way the seconds will be properly synchronized.
1 comments

Instead of a string containing code, you should use an anonymous function.