benchmark: repair the fs/readfile benchmark

PR-URL: https://github.com/nodejs/node/pull/7818
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Sorin Baltateanu 2016-07-21 14:08:28 +03:00 committed by James M Snell
parent a45c2db4b6
commit d9b0e4c729

View File

@ -22,8 +22,10 @@ function main(conf) {
data = null;
var reads = 0;
var bench_ended = false;
bench.start();
setTimeout(function() {
bench_ended = true;
bench.end(reads);
try { fs.unlinkSync(filename); } catch (e) {}
process.exit(0);
@ -41,7 +43,8 @@ function main(conf) {
throw new Error('wrong number of bytes returned');
reads++;
read();
if (!bench_ended)
read();
}
var cur = +conf.concurrent;