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 authored and James M Snell committed 2017-03-24 15:21:21 -07:00
1 parent a45c2db4b6
commit d9b0e4c729
1 file changed
+4 -1
+4 -1
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;