MCPcopy Create free account
hub / github.com/codeaashu/claude-code / ElapsedTimer

Function ElapsedTimer

web/components/tools/ToolUseBlock.tsx:64–76  ·  view source on GitHub ↗
({ startMs }: { startMs: number })

Source from the content-addressed store, hash-verified

62// ─── Elapsed timer ────────────────────────────────────────────────────────────
63
64function ElapsedTimer({ startMs }: { startMs: number }) {
65 const [elapsed, setElapsed] = useState(0);
66
67 useEffect(() => {
68 const interval = setInterval(() => {
69 setElapsed(Date.now() - startMs);
70 }, 100);
71 return () => clearInterval(interval);
72 }, [startMs]);
73
74 if (elapsed < 1000) return <span>{elapsed}ms</span>;
75 return <span>{(elapsed / 1000).toFixed(1)}s</span>;
76}
77
78// ─── Status badge ─────────────────────────────────────────────────────────────
79

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected