Skip to content

Commit

Permalink
benchmark: avoid using console.log()
Browse files Browse the repository at this point in the history
PR-URL: #38370
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Beth Griggs <bgriggs@redhat.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information
aduh95 authored and targos committed Jun 11, 2021
1 parent c170026 commit f4cb8b8
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 @@ -283,7 +283,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 @@ -292,7 +292,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 f4cb8b8

Please sign in to comment.