MCPcopy Index your code
hub / github.com/PrairieLearn/PrairieLearn / fmtShort

Function fmtShort

public/javascripts/socket.io.js:980–994  ·  view source on GitHub ↗

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

(ms)

Source from the content-addressed store, hash-verified

978 */
979
980 function fmtShort(ms) {
981 if (ms >= d) {
982 return Math.round(ms / d) + 'd'
983 }
984 if (ms >= h) {
985 return Math.round(ms / h) + 'h'
986 }
987 if (ms >= m) {
988 return Math.round(ms / m) + 'm'
989 }
990 if (ms >= s) {
991 return Math.round(ms / s) + 's'
992 }
993 return ms + 'ms'
994 }
995
996 /**
997 * Long format for `ms`.

Callers 1

socket.io.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected