Skip to content

Commit

Permalink
benchmark: avoid using console.log()
Browse files Browse the repository at this point in the history
  • Loading branch information
aduh95 committed Apr 23, 2021
1 parent 4f11b8b commit 0a99d57
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions benchmark/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ function formatResult(data) {
let rate = data.rate.toString().split('.');
rate[0] = rate[0].replace(/(\d)(?=(?:\d\d\d)+(?!\d))/g, '$1,');
rate = (rate[1] ? rate.join('.') : rate[0]);
return `${data.name}${conf}: ${rate}`;
return `${data.name}${conf}: ${rate}\n`;
}

function sendResult(data) {
Expand All @@ -280,7 +280,7 @@ function sendResult(data) {
process.send(data);
} else {
// Otherwise report by stdout
console.log(formatResult(data));
process.stdout.write(formatResult(data));
}
}

Expand Down

0 comments on commit 0a99d57

Please sign in to comment.