added forEach test

v1.18.x
Baris Soner Usakli 12 years ago
parent 7e35b26a43
commit 12f78f5d56

@ -40,13 +40,27 @@
var diff = process.hrtime(time);
diff = diff[0] + diff[1] / 1e9;
return diff;
}
function withForeach() {
var time = process.hrtime();
for(var n=0; n<runCount; ++n) {
myArray.forEach(function(index) {
});
}
var diff = process.hrtime(time);
diff = diff[0] + diff[1] / 1e9;
return diff;
}
benchData['runs'] = runCount;
benchData['withCaching'] = withCaching();
benchData['withoutCaching'] = withoutCaching();
benchData['withForeach'] = withForeach();
res.json(benchData);

Loading…
Cancel
Save