replace all clocks with a generic TimeType

This commit is contained in:
Lion Kortlepel
2022-11-11 21:58:00 +01:00
parent c7f6835702
commit 01bcc3d18c
10 changed files with 39 additions and 33 deletions

View File

@@ -2,21 +2,21 @@
#include "Common.h"
TScopedTimer::TScopedTimer()
: mStartTime(std::chrono::system_clock::now()) {
: mStartTime(TimeType::now()) {
}
TScopedTimer::TScopedTimer(const std::string& mName)
: mStartTime(std::chrono::system_clock::now())
: mStartTime(TimeType::now())
, Name(mName) {
}
TScopedTimer::TScopedTimer(std::function<void(size_t)> OnDestroy)
: OnDestroy(OnDestroy)
, mStartTime(std::chrono::system_clock::now()) {
, mStartTime(TimeType::now()) {
}
TScopedTimer::~TScopedTimer() {
auto EndTime = std::chrono::system_clock::now();
auto EndTime = TimeType::now();
auto Delta = EndTime - mStartTime;
size_t TimeDelta = Delta / std::chrono::milliseconds(1);
if (OnDestroy) {