Skip to content

Instantly share code, notes, and snippets.

@toadkicker
Created June 12, 2013 19:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save toadkicker/5768516 to your computer and use it in GitHub Desktop.
Save toadkicker/5768516 to your computer and use it in GitHub Desktop.
delay(function, time)
var delay = (function(){
var timer = 0;
return function(callback, ms){
clearTimeout (timer);
timer = setTimeout(callback, ms);
};
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment