INNER CODE UNIT · JavaScript

idx

nodejs/undici · benchmarks/_util/index.js:64

  const idx = Math.min(Math.floor(Math.log(num) / Math.log(1024)), prefixes.length - 1)

  return `${(num / Math.pow(1024, idx)).toFixed(2)}${prefixes[idx]}`
}

module.exports = { makeParallelRequests, printResults, formatBytes }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…