mirror of https://github.com/nodejs/node.git
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>pull/10434/head
parent
c74d9d672e
commit
17eb8fce05
|
@ -185,7 +185,9 @@ function formatResult(data) {
|
||||||
conf += ' ' + key + '=' + JSON.stringify(data.conf[key]);
|
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) {
|
function sendResult(data) {
|
||||||
|
|
|
@ -56,7 +56,9 @@ if (format === 'csv') {
|
||||||
conf = conf.replace(/"/g, '""');
|
conf = conf.replace(/"/g, '""');
|
||||||
console.log(`"${data.name}", "${conf}", ${data.rate}, ${data.time}`);
|
console.log(`"${data.name}", "${conf}", ${data.rate}, ${data.time}`);
|
||||||
} else {
|
} 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…
Reference in New Issue