For loop: i++ vs. ++i (v2)

Revision 2 of this benchmark created by Erik Oey on


Preparation HTML

<script>
  var l = 100000;
  
  function doNothing() {
  }
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Post-Increment
for (var i = 0; i < l; i++) {
  doNothing();
}
ready
Pre-Increment
for (var i = 0; i < l; ++i) {
  doNothing();
}
ready

Revisions

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