diff --git a/include/spdlog/stopwatch.h b/include/spdlog/stopwatch.h index d19e591f..54ab3d3b 100644 --- a/include/spdlog/stopwatch.h +++ b/include/spdlog/stopwatch.h @@ -39,6 +39,10 @@ public: return std::chrono::duration(clock::now() - start_tp_); } + std::chrono::milliseconds elapsed_ms() const { + return std::chrono::duration_cast(clock::now() - start_tp_); + } + void reset() { start_tp_ = clock::now(); } }; } // namespace spdlog