| 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 | { |