setInterval

Count Down

setInterval(function() {
    refresh(started_stamp - new Date().valueOf())
}, 1);  // Normal

vs.

setInterval(function() {
    refresh(left_seconds--)
}, 1);  // Slow

References

[1] Timers@W3C, WD-html5-20110525

[2] Docs@MDN, WindowTimers.setInterval() — Repeatedly calls a function or executes a code snippet, with a fixed time delay between each call. Returns an intervalID.

[3] Deniz Dogan@StackOverflow, Will setInterval drift?

results matching ""

    No results matching ""