MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/PositionBasedDynamics / stopTiming

Method stopTiming

Utils/Timing.h:100–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98 }
99
100 FORCE_INLINE static double stopTiming(bool print = true)
101 {
102 if (!Timing::m_timingStack.empty())
103 {
104 Timing::m_stopCounter++;
105 std::chrono::time_point<std::chrono::high_resolution_clock> stop = std::chrono::high_resolution_clock::now();
106 TimingHelper h = Timing::m_timingStack.top();
107 Timing::m_timingStack.pop();
108 std::chrono::duration<double> elapsed_seconds = stop - h.start;
109 double t = elapsed_seconds.count() * 1000.0;
110
111 if (print)
112 LOG_INFO << "time " << h.name.c_str() << ": " << t << " ms";
113 return t;
114 }
115 return 0;
116 }
117
118 FORCE_INLINE static double stopTiming(bool print, int &id)
119 {

Callers

nothing calls this directly

Calls 6

topMethod · 0.80
c_strMethod · 0.80
emptyMethod · 0.45
countMethod · 0.45
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected