MCPcopy Index your code
hub / github.com/nodejs/node / formatResult

Function formatResult

benchmark/common.js:313–324  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

311}
312
313function formatResult(data) {
314 // Construct configuration string, " A=a, B=b, ..."
315 let conf = '';
316 for (const key of Object.keys(data.conf)) {
317 conf += ` ${key}=${JSON.stringify(data.conf[key])}`;
318 }
319
320 let rate = data.rate.toString().split('.');
321 rate[0] = rate[0].replace(/(\d)(?=(?:\d\d\d)+(?!\d))/g, '$1,');
322 rate = (rate[1] ? rate.join('.') : rate[0]);
323 return `${data.name}${conf}: ${rate}\n`;
324}
325
326function sendResult(data) {
327 if (process.send) {

Callers 1

sendResultFunction · 0.85

Calls 4

keysMethod · 0.65
splitMethod · 0.45
toStringMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…