ConditionTest

Benchmark created on


Description

Test

Setup

var tab = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20];
    var length = tab.length, tab_length = length-1;
    var sum = '';

Test runner

Ready to run.

Testing in
TestOps/sec
First
for (var i = 0; i < length; i++) {
  sum += tab[i];
}
ready
Second
while (length--) {
  var i = tab_length-length;
  sum += tab[i];
  console.log(i);
}
ready

Revisions

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