Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

benchmark: avoid using console.log() #38370

Merged
merged 1 commit into from Apr 27, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions benchmark/common.js
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));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it have a comment to warn someone from changing it back at a future date?

}
}

Expand Down