| 85 | } |
| 86 | |
| 87 | int64_t cbm_parse_duration_checked(const char *start_nano, const char *end_nano, bool *ok) { |
| 88 | int64_t start = 0; |
| 89 | int64_t end = 0; |
| 90 | bool read_both = trace_read_nano(start_nano, &start) && trace_read_nano(end_nano, &end); |
| 91 | if (ok) { |
| 92 | *ok = read_both; |
| 93 | } |
| 94 | if (!read_both) { |
| 95 | return 0; |
| 96 | } |
| 97 | return (end > start) ? (end - start) : 0; |
| 98 | } |
| 99 | |
| 100 | int64_t cbm_parse_duration(const char *start_nano, const char *end_nano) { |
| 101 | if (!start_nano || !end_nano) { |
no test coverage detected