MCPcopy Create free account
hub / github.com/SagerNet/sing-box-dashboard / formatClockTime

Function formatClockTime

src/api/format.ts:74–77  ·  view source on GitHub ↗
(timestampMs: number)

Source from the content-addressed store, hash-verified

72 const seconds = durationMs / 1000;
73 if (seconds < 60) {
74 return `${seconds.toFixed(seconds < 10 ? 1 : 0)}s`;
75 }
76 const minutes = Math.floor(seconds / 60);
77 if (minutes < 60) {
78 return `${minutes}m ${Math.round(seconds % 60)}s`;
79 }
80 const hours = Math.floor(minutes / 60);

Callers 1

Calls 1

pad2Function · 0.85

Tested by

no test coverage detected