benchmark: avoid using console.log()
PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
parent
47207e59f0
commit
0c879cb7b8
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user