add numbers (v2)

Revision 2 of this benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
loop
var j = 0;

for(var i=1;i<=100;i++){
j+=i;
}
ready
recursion
var add = function(i) {
return i === 1 ? 1 : i + add(--i);
};

var j = add(100);
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.