Created
March 12, 2014 15:24
-
-
Save mraleph/9509144 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
function GeneratedBenchmarkingFunction() { | |
/* Benchmark.prototype.setup goes here */ | |
var start = new Date; | |
for (...) { /* do N iterations of test body */ | |
/* test case goes here */ | |
} | |
var end = new Date; | |
/* Benchmark.prototype.teardown goes here */ | |
/* N / (end - start) gives ops per ms result */ | |
}; |
safjanowski
commented
Mar 12, 2014
function GeneratedBenchmarkingFunction() {
var start = new Date;
for (...) { /* do N iterations of test body */
function matchRegexp() {
var r = new RegExp(/^((auto)|\d+[a-z]*)$/);
'auto'.match(r);
'10px'.match(r);
'Lorem ipsum dolor sit amet'.match(r);
}
}
var end = new Date;
/* Benchmark.prototype.teardown goes here */
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment