Skip to content

Instantly share code, notes, and snippets.

@seansullivan
Created August 17, 2010 03:16
Show Gist options
  • Save seansullivan/528295 to your computer and use it in GitHub Desktop.
Save seansullivan/528295 to your computer and use it in GitHub Desktop.
function supaTest(){
var tests = [{'name':1},{'name':2}];
var delay = 2000;
for (var i=0; i < tests.length; i++) {
setTimeout( function (test) {
return function () {
console.log(new Date());
console.log(test.name)
}
}(tests[i]),
delay);
if(delay == 2000) delay = 0;
}
}
supaTest();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment