MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / formatWallClock

Function formatWallClock

apps/vis/web/src/util/time.ts:28–33  ·  view source on GitHub ↗
(epochMs: number)

Source from the content-addressed store, hash-verified

26
27/** Format an epoch-ms timestamp as HH:MM:SS (wall clock). */
28export function formatWallClock(epochMs: number): string {
29 if (!epochMs || !Number.isFinite(epochMs)) return '--:--:--';
30 const d = new Date(epochMs);
31 const pad = (n: number) => String(n).padStart(2, '0');
32 return `${pad(d.getHours())}:${pad(d.getMinutes())}:${pad(d.getSeconds())}`;
33}
34
35/** Format a duration in ms as a compact human string (e.g. "840ms", "2.4s", "1m03s"). */
36export function formatDuration(ms: number | null | undefined): string {

Callers 2

LogRowFunction · 0.90
WireRow.tsxFile · 0.90

Calls 1

padFunction · 0.70

Tested by

no test coverage detected