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

Function nanoSecondsToString

benchmark/common.js:304–311  ·  view source on GitHub ↗
(bigint)

Source from the content-addressed store, hash-verified

302}
303
304function nanoSecondsToString(bigint) {
305 const str = bigint.toString();
306 const decimalPointIndex = str.length - 9;
307 if (decimalPointIndex <= 0) {
308 return `0.${'0'.repeat(-decimalPointIndex)}${str}`;
309 }
310 return `${str.slice(0, decimalPointIndex)}.${str.slice(decimalPointIndex)}`;
311}
312
313function formatResult(data) {
314 // Construct configuration string, " A=a, B=b, ..."

Callers 1

reportMethod · 0.85

Calls 2

sliceMethod · 0.65
toStringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…