MCPcopy Create free account
hub / github.com/Snapchat/Valdi / formatMillisForLog

Function formatMillisForLog

valdi/vscode_debugger/src/common/stringUtils.ts:26–36  ·  view source on GitHub ↗
(millis: number)

Source from the content-addressed store, hash-verified

24}
25
26export function formatMillisForLog(millis: number): string {
27 function pad(n: number, d: number): string {
28 const result = String(n);
29 return '0'.repeat(d - result.length) + result;
30 }
31 const d = new Date(millis);
32 return `${pad(d.getHours(), 2)}:${pad(d.getMinutes(), 2)}:${pad(d.getSeconds(), 2)}.${pad(
33 d.getMilliseconds(),
34 3,
35 )}`;
36}
37
38const regexChars = '/\\.?*()^${}|[]+';
39

Callers

nothing calls this directly

Calls 1

padFunction · 0.70

Tested by

no test coverage detected