Skip to content

Instantly share code, notes, and snippets.

@mraleph
Created January 23, 2014 20:15
Show Gist options
  • Save mraleph/8585983 to your computer and use it in GitHub Desktop.
Save mraleph/8585983 to your computer and use it in GitHub Desktop.
function B1() {
// Benchmark.prototype.setup goes here
var str = '1.1';
var start = new Date;
for (...) { // do N iterations of test body
str++;
}
var end = new Date;
};
function B2() {
// Benchmark.prototype.setup goes here
var str = '1.1';
var start = new Date;
for (...) { // do N iterations of test body
parseFloat(str);
}
var end = new Date;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment