@clickup/ent-framework
Version:
A PostgreSQL graph-database-alike library with microsharding and row-level security
18 lines • 745 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.formatTimeWithMs = formatTimeWithMs;
let prevDate = null;
function formatTimeWithMs(date, withDelta = false) {
const h = date.getHours().toString();
const m = date.getMinutes().toString();
const s = date.getSeconds().toString();
const ms = date.getMilliseconds().toString();
let deltaMs = null;
if (withDelta) {
deltaMs = prevDate ? date.getTime() - prevDate.getTime() : 0;
prevDate = date;
}
return (`${h.padStart(2, "0")}:${m.padStart(2, "0")}:${s.padStart(2, "0")}.${ms.padStart(3, "0")}` +
(deltaMs !== null ? " in " + `${deltaMs}ms`.padStart(7) : ""));
}
//# sourceMappingURL=formatTimeWithMs.js.map
;