Update stopwatch.h (#3034)

Adding elapsed time in milliseconds.
This commit is contained in:
Alan Candido 2024-03-09 16:40:05 -03:00 committed by gabime
parent 87b8401011
commit 5a207ad9ce

View File

@ -38,6 +38,10 @@ public:
std::chrono::duration<double> elapsed() const { return std::chrono::duration<double>(clock::now() - start_tp_); }
std::chrono::milliseconds elapsed_ms() const {
return std::chrono::duration_cast<std::chrono::milliseconds>(clock::now() - start_tp_);
}
void reset() { start_tp_ = clock::now(); }
};
} // namespace spdlog