breakneck while vs for

Benchmark created by Rick Waldron on


Preparation HTML

var length = 1e10;
 
<script>
  var length = 1e10,
      i;
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
while
i = 0;

while (i < length) {
 i++;
}
ready
for
i = 0;

for (i < length) {
 i++;
}
ready

Revisions

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

  • Revision 1: published by Rick Waldron on