MCPcopy Create free account
hub / github.com/async-profiler/async-profiler / parseTimeout

Method parseTimeout

src/arguments.cpp:554–564  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

552}
553
554int Arguments::parseTimeout(const char* str) {
555 const char* p = strchr(str, ':');
556 if (p == NULL) {
557 return parseUnits(str, SECONDS);
558 }
559
560 int hh = str[0] >= '0' && str[0] <= '2' ? atoi(str) : 0xff;
561 int mm = p[1] >= '0' && p[1] <= '5' ? atoi(p + 1) : 0xff;
562 int ss = (p = strchr(p + 1, ':')) != NULL && p[1] >= '0' && p[1] <= '5' ? atoi(p + 1) : 0xff;
563 return 0xff000000 | hh << 16 | mm << 8 | ss;
564}
565
566Arguments::~Arguments() {
567 if (!_shared) free(_buf);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected