Skip to content

Commit

Permalink
benchmark beginings
Browse files Browse the repository at this point in the history
  • Loading branch information
tmpvar committed Mar 5, 2011
1 parent f39becd commit 7b64084
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions benchmark/mark.js
@@ -0,0 +1,23 @@
// Taken from: http://ejohn.org/blog/javascript-benchmark-quality/
module.exports = runTest(name, test, next, callback){
var runs = [], r = 0;
setTimeout(function(){
var start = Date.now(), diff = 0;

for ( var n = 0; diff < 1000; n++ ) {
test();
diff = Date.now() - start;
}

runs.push( n );

if ( r++ < 4 )
setTimeout( arguments.callee, 0 );
else {
done(name, runs);
if ( next )
setTimeout( next, 0 );
}
}, 0);
}

Empty file added benchmark/stats.json
Empty file.

0 comments on commit 7b64084

Please sign in to comment.