MCPcopy Create free account
hub / github.com/BYVoid/OpenCC / SetDefaultTimeUnitFromFlag

Function SetDefaultTimeUnitFromFlag

deps/google-benchmark/src/benchmark.cc:585–597  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

583}
584
585void SetDefaultTimeUnitFromFlag(const std::string& time_unit_flag) {
586 if (time_unit_flag == "s") {
587 return SetDefaultTimeUnit(kSecond);
588 } else if (time_unit_flag == "ms") {
589 return SetDefaultTimeUnit(kMillisecond);
590 } else if (time_unit_flag == "us") {
591 return SetDefaultTimeUnit(kMicrosecond);
592 } else if (time_unit_flag == "ns") {
593 return SetDefaultTimeUnit(kNanosecond);
594 } else if (!time_unit_flag.empty()) {
595 PrintUsageAndExit();
596 }
597}
598
599void ParseCommandLineFlags(int* argc, char** argv) {
600 using namespace benchmark;

Callers 1

ParseCommandLineFlagsFunction · 0.85

Calls 3

SetDefaultTimeUnitFunction · 0.85
PrintUsageAndExitFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected