Loop test (v2)

Revision 2 of this benchmark created on


Description

Test the speed of a for loop when incrementing vs decrementing.

Setup

function loopInc() {
      for(var i = 0; i < 1000; i++) {
        //
      }
    }
    
    function loopDec() {
      for(var i = 1000; i > 0; i--) {
        //
      }  
    }

Test runner

Ready to run.

Testing in
TestOps/sec
Increment
loopInc();
ready
Decrement
loopDec();
ready

Revisions

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