diff --git a/benchmark/fs/readfile.js b/benchmark/fs/readfile.js index f58550fae83f96..9fc8316743e285 100644 --- a/benchmark/fs/readfile.js +++ b/benchmark/fs/readfile.js @@ -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;