Skip to content

Instantly share code, notes, and snippets.

@yorkie
Created January 29, 2014 03:43
Show Gist options
  • Select an option

  • Save yorkie/8681456 to your computer and use it in GitHub Desktop.

Select an option

Save yorkie/8681456 to your computer and use it in GitHub Desktop.
random timer
function startTimer(fn) {
var interval = Math.random()*100;
console.log('interval:',interval);
var timer = setTimeout(function() {
fn();
startTimer(fn);
}, interval);
}
startTimer(function() {
console.log(1);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment