| 48 | } |
| 49 | |
| 50 | function 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 | |
| 69 | export function parsePsOutput(output) { |
| 70 | return output |