Loop test

Benchmark created by Peter C 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; 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.