Skip to content

Instantly share code, notes, and snippets.

@lasryaric
Created August 17, 2012 02:27
Show Gist options
  • Select an option

  • Save lasryaric/3375401 to your computer and use it in GitHub Desktop.

Select an option

Save lasryaric/3375401 to your computer and use it in GitHub Desktop.
runx.js
function runx (func, n, wait, args)
{
var count = 0;
var f = function()
{
if (count < n)
{
func.apply(this, args);
setTimeout(f, wait);
count++;
}
}
f();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment