MCPcopy
hub / github.com/vercel/ms / fmtShort

Function fmtShort

index.js:113–128  ·  view source on GitHub ↗

* Short format for `ms`. * * @param {Number} ms * @return {String} * @api private

(ms)

Source from the content-addressed store, hash-verified

111 */
112
113function fmtShort(ms) {
114 var msAbs = Math.abs(ms);
115 if (msAbs >= d) {
116 return Math.round(ms / d) + 'd';
117 }
118 if (msAbs >= h) {
119 return Math.round(ms / h) + 'h';
120 }
121 if (msAbs >= m) {
122 return Math.round(ms / m) + 'm';
123 }
124 if (msAbs >= s) {
125 return Math.round(ms / s) + 's';
126 }
127 return ms + 'ms';
128}
129
130/**
131 * Long format for `ms`.

Callers 1

index.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…