Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Loop methods
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36 Edg/139.0.0.0
Browser:
Chrome 139
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
for
47/s
for len
46/s
while
42/s
while len
41/s
View exact numbers
Test name
Executions per second
✓
for
47 Ops/sec
for len
46 Ops/sec
while
42 Ops/sec
while len
41 Ops/sec
Tests:
for
const arr = new Array(10000) for (let i = 0; i < arr.length; i++) { console.log(i); }
for len
const arr = new Array(10000) const len = arr.length for (let i = 0; i < len; i++) { console.log(i); }
while
let i = 0; const arr = new Array(10000) while (i < arr.length) { console.log(i); i++; }
while len
let i = 0; const arr = new Array(10000) const len = arr.length while (i < len) { console.log(i); i++; }