Last active
August 29, 2015 14:15
-
-
Save mourner/2bba4381d52c454e1b66 to your computer and use it in GitHub Desktop.
simple benchmarking snippet for v8 & node
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
function test() { | |
for (var i = 0, array = []; i < 1000; i++) array.push(i, i); | |
} | |
var start = Date.now(), ops = 0; | |
do { test(); ops++; } while (Date.now() - start < 1000); | |
(typeof console !== 'undefined' ? console.log : print)(ops + ' ops/s'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment