summaryrefslogtreecommitdiff
path: root/benchmark
diff options
context:
space:
mode:
authorSorin Baltateanu <sorin.baltateanu@intel.com>2016-07-21 14:08:28 +0300
committerJames M Snell <jasnell@gmail.com>2017-03-24 15:21:21 -0700
commitd9b0e4c729fedfe5369ada4229fd170bd6dc7e2f (patch)
tree48d0bfcb929544b0d7717af2900b4fa6abd33469 /benchmark
parenta45c2db4b67a95f40f66852dd35e45ae9677df05 (diff)
downloadandroid-node-v8-d9b0e4c729fedfe5369ada4229fd170bd6dc7e2f.tar.gz
android-node-v8-d9b0e4c729fedfe5369ada4229fd170bd6dc7e2f.tar.bz2
android-node-v8-d9b0e4c729fedfe5369ada4229fd170bd6dc7e2f.zip
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>
Diffstat (limited to 'benchmark')
-rw-r--r--benchmark/fs/readfile.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/benchmark/fs/readfile.js b/benchmark/fs/readfile.js
index f58550fae8..9fc8316743 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;