| 15 | started_(active_ ? std::chrono::steady_clock::now() : std::chrono::steady_clock::time_point{}) {} |
| 16 | |
| 17 | ScopeTimer::~ScopeTimer() { |
| 18 | if (!active_) { |
| 19 | return; |
| 20 | } |
| 21 | const auto ended = std::chrono::steady_clock::now(); |
| 22 | const auto micros = std::chrono::duration_cast<std::chrono::microseconds>(ended - started_).count(); |
| 23 | log_message(level_, category_, name_ + " took " + std::to_string(micros) + " us"); |
| 24 | } |
| 25 | |
| 26 | } // namespace engine::debug |
nothing calls this directly
no test coverage detected