Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
benchmark: use commas in non-csv rate output
  • Loading branch information
mscdex committed Dec 20, 2016
commit d62f2c8079ffcd9a4342010264813dd4980f0ab1
4 changes: 3 additions & 1 deletion benchmark/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,9 @@ function formatResult(data) {
conf += ' ' + key + '=' + JSON.stringify(data.conf[key]);
}

return `${data.name}${conf}: ${data.rate}`;
const rate = Math.floor(data.rate)
.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1,');
return `${data.name}${conf}: ${rate}`;
}

function sendResult(data) {
Expand Down
4 changes: 3 additions & 1 deletion benchmark/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ if (format === 'csv') {
conf = conf.replace(/"/g, '""');
console.log(`"${data.name}", "${conf}", ${data.rate}, ${data.time}`);
} else {
console.log(`${data.name} ${conf}: ${data.rate}`);
const rate = Math.floor(data.rate)
.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1,');
console.log(`${data.name} ${conf}: ${rate}`);
}
});

Expand Down