Skip to content

Instantly share code, notes, and snippets.


Chris Shoemaker shoe

View GitHub Profile
shoe / interval.js
Created May 9, 2012 02:52 — forked from manast/interval.js
Accurate Javascript setInterval replacement
View interval.js
function interval(duration, fn){
this.baseline = undefined = function(){
if(this.baseline === undefined){
this.baseline = new Date().getTime()
var end = new Date().getTime()
this.baseline += duration