diff --git a/include/spdlog/stopwatch.h b/include/spdlog/stopwatch.h index 115f56705..4a383eb44 100644 --- a/include/spdlog/stopwatch.h +++ b/include/spdlog/stopwatch.h @@ -38,6 +38,10 @@ class stopwatch { std::chrono::duration elapsed() const { 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