var zil = []; for (i=0; i < 10000; ++i) zil[i] = i+3; var s = 0. for (j=0; j < 1000; ++j) for (i=0; i < 10000; ++i) s += zil[i]; document.writeln(s+",");
On a 1.83GHz core duo Intel.
1.3 sec | Webkit 71897 or Safari 5.0.2 | 130 ns per iteration. |
0.11 sec | Chrome 7 | 11 ns per iteration |
0.30 sec | Firefox 3.6 | 30 ns per iteration |