Skip to content

Commit 7aeeee3

Browse files
Sorin BaltateanuMylesBorins
Sorin Baltateanu
authored andcommitted
benchmark: repair the fs/readfile benchmark
PR-URL: #7818 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent ade64e6 commit 7aeeee3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

benchmark/fs/readfile.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ function main(conf) {
2222
data = null;
2323

2424
var reads = 0;
25+
var bench_ended = false;
2526
bench.start();
2627
setTimeout(function() {
28+
bench_ended = true;
2729
bench.end(reads);
2830
try { fs.unlinkSync(filename); } catch (e) {}
2931
process.exit(0);
@@ -41,7 +43,8 @@ function main(conf) {
4143
throw new Error('wrong number of bytes returned');
4244

4345
reads++;
44-
read();
46+
if (!bench_ended)
47+
read();
4548
}
4649

4750
var cur = +conf.concurrent;

0 commit comments

Comments
 (0)