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

@@ -4,6 +4,8 @@
#include <functional>
#include <string>
#include "Common.h"
class TScopedTimer {
public:
TScopedTimer();
@@ -11,7 +13,7 @@ public:
TScopedTimer(std::function<void(size_t)> OnDestroy);
~TScopedTimer();
auto GetElapsedTime() const {
auto EndTime = std::chrono::system_clock::now();
auto EndTime = TimeType::now();
auto Delta = EndTime - mStartTime;
size_t TimeDelta = Delta / std::chrono::milliseconds(1);
return TimeDelta;
@@ -20,6 +22,6 @@ public:
std::function<void(size_t /* time_ms */)> OnDestroy { nullptr };
private:
std::chrono::system_clock::time_point mStartTime;
TimeType::time_point mStartTime;
std::string Name;
};