MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / formatDuration

Function formatDuration

scripts/integration/cli.mjs:2144–2155  ·  view source on GitHub ↗
(ms)

Source from the content-addressed store, hash-verified

2142}
2143
2144function formatDuration(ms) {
2145 if (!Number.isFinite(ms)) {
2146 return "n/a";
2147 }
2148 if (ms >= 60_000) {
2149 return `${(ms / 60_000).toFixed(2)}m`;
2150 }
2151 if (ms >= 1_000) {
2152 return `${(ms / 1_000).toFixed(2)}s`;
2153 }
2154 return `${Math.max(0, Math.round(ms))}ms`;
2155}
2156
2157function logStep(message) {
2158 if (verbose) {

Callers 2

measuredStepFunction · 0.70
printTimingSummaryFunction · 0.70

Calls 1

maxMethod · 0.80

Tested by

no test coverage detected