MCPcopy Create free account
hub / github.com/CMU-Perceptual-Computing-Lab/openpose / timerInit

Method timerInit

src/openpose/utilities/profiler.cpp:86–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84 }
85
86 const std::string Profiler::timerInit(const int line, const std::string& function, const std::string& file)
87 {
88 #ifdef PROFILER_ENABLED
89 const auto key = getKey(line, function, file);
90 std::unique_lock<std::mutex> lock{sMutexProfiler};
91 if (sProfilerTuple.count(key) > 0)
92 std::get<2>(sProfilerTuple[key]) = std::chrono::high_resolution_clock::now();
93 else
94 sProfilerTuple[key] = {std::make_tuple(0., 0ull, std::chrono::high_resolution_clock::now())};
95 lock.unlock();
96 return key;
97 #else
98 UNUSED(line);
99 UNUSED(function);
100 UNUSED(file);
101 return "";
102 #endif
103 }
104
105 void Profiler::timerEnd(const std::string& key)
106 {

Callers

nothing calls this directly

Calls 2

getKeyFunction · 0.85
countMethod · 0.80

Tested by

no test coverage detected