MCPcopy Index your code
hub / github.com/prototypejs/prototype / format

Function format

test/unit/static/js/mocha.js:1681–1691  ·  view source on GitHub ↗

* Format the given `ms`. * * @param {Number} ms * @return {String} * @api public

(ms)

Source from the content-addressed store, hash-verified

1679 */
1680
1681function format(ms) {
1682 if (ms == d) return Math.round(ms / d) + ' day';
1683 if (ms > d) return Math.round(ms / d) + ' days';
1684 if (ms == h) return Math.round(ms / h) + ' hour';
1685 if (ms > h) return Math.round(ms / h) + ' hours';
1686 if (ms == m) return Math.round(ms / m) + ' minute';
1687 if (ms > m) return Math.round(ms / m) + ' minutes';
1688 if (ms == s) return Math.round(ms / s) + ' second';
1689 if (ms > s) return Math.round(ms / s) + ' seconds';
1690 return ms + ' ms';
1691}
1692}); // module: ms.js
1693
1694require.register("reporters/base.js", function(module, exports, require){

Callers 1

mocha.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected