From ca7c846089a62ab27dde3d2b3722451a7d190550 Mon Sep 17 00:00:00 2001 From: gabime Date: Sat, 16 Mar 2024 19:30:49 +0200 Subject: [PATCH] Fixed warning --- include/spdlog/stopwatch.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/spdlog/stopwatch.h b/include/spdlog/stopwatch.h index 4a383eb4..02113b2f 100644 --- a/include/spdlog/stopwatch.h +++ b/include/spdlog/stopwatch.h @@ -36,8 +36,10 @@ public: stopwatch() : start_tp_{clock::now()} {} + [[nodiscard]] std::chrono::duration elapsed() const { return std::chrono::duration(clock::now() - start_tp_); } + [[nodiscard]] std::chrono::milliseconds elapsed_ms() const { return std::chrono::duration_cast(clock::now() - start_tp_); }