Last active
May 20, 2016 14:35
-
-
Save beshur/a5f663f76e30bc1d7a27a3d4ea6b0aad to your computer and use it in GitHub Desktop.
simple memory test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// simple memory test | |
var memoryTest = function() { | |
function clickTest() { | |
var test = 'clickTest ' + iteration; | |
if (this.timing) { | |
console.time(test); | |
} else { | |
console.info(test); | |
} | |
$(".plugintab label").each(function(i, el){$(el).find("span:first").click();}) | |
if (this.timing) { | |
console.timeEnd(test); | |
} | |
iteration++; | |
} | |
function lastIteration() { | |
alert('clickTest iteration #' + iteration + '/' + this.times + ' - test is over'); | |
} | |
var iteration = 0; | |
this.times = 1000; | |
this.timing = true; | |
this.start = function() { | |
var iteration = 0, | |
times = this.times; | |
while(times-->0) { | |
clickTest(); | |
if (times === 1) { | |
window.setTimeout(lastIteration, 0); | |
} | |
}; | |
}; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment