For vs While (v4)

Revision 4 of this benchmark created by Wizek on


Preparation HTML

<script>
  var doStuff = function(i) {
   return i;
  }
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
for
for (var n = 0; n < 100; n++) {
 doStuff(n)
}
ready
while
var n = 100;
while (n--) {
 doStuff(n);
}
ready

Revisions

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