MCPcopy
hub / github.com/codeaashu/claude-code / formatDuration

Function formatDuration

src/bridge/jwtUtils.ts:8–13  ·  view source on GitHub ↗

Format a millisecond duration as a human-readable string (e.g. "5m 30s").

(ms: number)

Source from the content-addressed store, hash-verified

6
7/** Format a millisecond duration as a human-readable string (e.g. "5m 30s"). */
8function formatDuration(ms: number): string {
9 if (ms < 60_000) return `${Math.round(ms / 1000)}s`
10 const m = Math.floor(ms / 60_000)
11 const s = Math.round((ms % 60_000) / 1000)
12 return s > 0 ? `${m}m ${s}s` : `${m}m`
13}
14
15/**
16 * Decode a JWT's payload segment without verifying the signature.

Callers 9

logSessionCompleteFunction · 0.70
logReconnectedFunction · 0.70
scheduleFunction · 0.70
scheduleFromExpiresInFunction · 0.70
doRefreshFunction · 0.70
updateStatusDisplayFunction · 0.70
onSessionDoneFunction · 0.70
runBridgeLoopFunction · 0.70
onSessionTimeoutFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected