MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / OneShotTimer

Method OneShotTimer

lib/timer.cpp:143–159  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141}
142
143OneShotTimer::OneShotTimer(std::string name)
144{
145 class MyResults : public TimerResultsIntf
146 {
147 private:
148 void addResults(const std::string &name, std::chrono::milliseconds duration) override
149 {
150 std::lock_guard<std::mutex> l(stdCoutLock);
151
152 // TODO: do not use std::cout directly
153 std::cout << name << ": " << durationToString(duration) << std::endl;
154 }
155 };
156
157 mResults.reset(new MyResults);
158 mTimer.reset(new Timer(std::move(name), mResults.get()));
159}

Callers

nothing calls this directly

Calls 2

resetMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected