MCPcopy
hub / github.com/CapSoftware/Cap / parseElapsedSeconds

Function parseElapsedSeconds

apps/desktop/scripts/desktop-memory-soak-lib.js:50–67  ·  view source on GitHub ↗
(etime)

Source from the content-addressed store, hash-verified

48}
49
50function parseElapsedSeconds(etime) {
51 const parts = etime.split("-");
52 const dayPart = parts.length === 2 ? Number(parts[0]) : 0;
53 const timePart = parts.length === 2 ? parts[1] : parts[0];
54 const segments = timePart.split(":").map(Number);
55
56 let hours = 0;
57 let minutes = 0;
58 let seconds = 0;
59
60 if (segments.length === 3) {
61 [hours, minutes, seconds] = segments;
62 } else if (segments.length === 2) {
63 [minutes, seconds] = segments;
64 }
65
66 return dayPart * 24 * 60 * 60 + hours * 60 * 60 + minutes * 60 + seconds;
67}
68
69export function parsePsOutput(output) {
70 return output

Callers 1

parsePsOutputFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected