MCPcopy Create free account
hub / github.com/microsoft/SandDance / formatTime

Function formatTime

docs/app/js/sanddance-app.js:58454–58461  ·  view source on GitHub ↗
(ms)

Source from the content-addressed store, hash-verified

58452parcelHelpers.export(exports, "formatValue", ()=>formatValue);
58453parcelHelpers.export(exports, "formatImage", ()=>formatImage);
58454function formatTime(ms) {
58455 let formatted;
58456 if (ms < 10) formatted = "".concat(ms.toFixed(2), "ms");
58457 else if (ms < 100) formatted = "".concat(ms.toFixed(1), "ms");
58458 else if (ms < 1000) formatted = "".concat(ms.toFixed(0), "ms");
58459 else formatted = "".concat((ms / 1000).toFixed(2), "s");
58460 return formatted;
58461}
58462function leftPad(string) {
58463 let length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 8;
58464 const padLength = Math.max(length - string.length, 0);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected