MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / cbm_parse_duration_checked

Function cbm_parse_duration_checked

src/traces/traces.c:87–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85}
86
87int64_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
100int64_t cbm_parse_duration(const char *start_nano, const char *end_nano) {
101 if (!start_nano || !end_nano) {

Callers 2

cbm_extract_http_infoFunction · 0.85
test_traces.cFile · 0.85

Calls 1

trace_read_nanoFunction · 0.85

Tested by

no test coverage detected