Skip to content

Instantly share code, notes, and snippets.

@beshur
Last active May 20, 2016 14:35
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 beshur/a5f663f76e30bc1d7a27a3d4ea6b0aad to your computer and use it in GitHub Desktop.
Save beshur/a5f663f76e30bc1d7a27a3d4ea6b0aad to your computer and use it in GitHub Desktop.
simple memory test
// 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