eslint-rule-benchmark
Version:
Benchmark ESLint rules with detailed performance metrics for CI and plugin development
12 lines (11 loc) • 401 B
JavaScript
import { formatNumber } from './format-number.js'
function formatMs(milliseconds) {
if (typeof milliseconds !== 'number' || !Number.isFinite(milliseconds)) {
return 'N/A'
}
let fixed = milliseconds.toFixed(3)
let [integerPart, decimalPart] = fixed.split('.')
let formattedInteger = formatNumber(Number(integerPart))
return `${formattedInteger}.${decimalPart} ms`
}
export { formatMs }