Skip to content
Permalink
Browse files
benchmark: avoid using console.log()
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 f4cb8b82813b9fc2db9db98c41aba178d4cae807
Showing with 2 additions and 2 deletions.
  1. +2 −2 benchmark/common.js
@@ -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) {
@@ -292,7 +292,7 @@ function sendResult(data) {
process.send(data);
} else {
// Otherwise report by stdout
console.log(formatResult(data));
process.stdout.write(formatResult(data));
}
}

0 comments on commit f4cb8b8

Please sign in to comment.