mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
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:
1 parent
ade64e61cd
commit
7aeeee3276
1 file changed
+4
-1
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user