for vs while vs setTimeout

Benchmark created by Maxence on


Description

Some test of for, while

Test runner

Ready to run.

Testing in
TestOps/sec
for <=
console.log('for <=');
for (i = 0; i <= 10; i++) {
  console.log(new Date().getTime());
}
ready
for <
console.log('for <');
for (i = 0; i < 10; i++) {
  console.log(new Date().getTime());
}
ready
while <=
console.log('while <=');
i = 0;
while (i <= 10) {
  console.log(new Date().getTime());
  i++;
}
ready
while <
console.log('while <');
i = 0;
while (i < 10) {
  console.log(new Date().getTime());
  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 Maxence on