Browse Source

benchmark: use commas in non-csv rate output

PR-URL: https://github.com/nodejs/node/pull/10360
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
v7.x
Brian White 8 years ago
committed by Evan Lucas
parent
commit
10b3297e8f
  1. 4
      benchmark/common.js
  2. 4
      benchmark/run.js

4
benchmark/common.js

@ -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) {

4
benchmark/run.js

@ -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}`);
}
});

Loading…
Cancel
Save