pocketlang/test/benchmark/for/for.js
Thakee Nathees df93b2c1ec gc bugs fixed
- popping operands from the stack was too early -fixed
- some temproary string objects weren't pushed to the vm's temp root
  -fixed
- and some minor bug fixed
2021-05-23 23:25:04 +05:30

10 lines
247 B
JavaScript

var start = +new Date();
list = []
for (var i = 0; i < 10000000; i++) { list.push(i) }
sum = 0
for (var i = 0; i < list.length; i++) { sum += list[i]; }
console.log(sum)
var end = +new Date();
console.log('elapsed: ' + (end - start)/1000 + 's');