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 Myles Borins committed 2017-03-28 19:12:50 -04:00
1 parent ade64e61cd
commit 7aeeee3276
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;