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 GitHub
parent 5532231bbc
commit a45c939040
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -39,6 +39,10 @@ public:
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