Skip to content

Instantly share code, notes, and snippets.

@yoko
Created November 17, 2011 15:26
Show Gist options
  • Save yoko/1373401 to your computer and use it in GitHub Desktop.
Save yoko/1373401 to your computer and use it in GitHub Desktop.
var custom_interval_process = [];
function customInterval(callback, get_delay) {
var uid = custom_interval_process.length,
index = 0;
(function loop() {
custom_interval_process[uid] = w.setTimeout(function() {
++index;
callback();
loop();
}, get_delay(index));
})();
return uid;
}
function customIntervalClear(uid) {
return w.clearTimeout(uid);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment