For vs While (v2)

Revision 2 of this benchmark created on


Preparation HTML

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

Test runner

Ready to run.

Testing in
TestOps/sec
For
var n = 100000;
for (; n; n--) {
 doStuff(n);
}
ready
while
var n = 100000;
while (n--) {
 doStuff(n);
}
ready

Revisions

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