Skip to content

Instantly share code, notes, and snippets.

@reesd
reesd / gist:989885
Created May 24, 2011 22:21 — forked from cowboy/gist:360138
setInterval and setTimeout patterns
// =========================
// SetInterval
// =========================
// While not truly accurate, setInterval is still fairly good, time-wise.
// Better for things like a "one second tick" but not great for expensive
// code executed at small intervals as iterations can "stack".
// (ECMAScript 5 strict mode compatible)