Add ScopedTimer, Remove some comments

This commit is contained in:
Lion Kortlepel
2021-10-31 01:27:21 +02:00
parent 50589fbe3d
commit fdc205f521
6 changed files with 52 additions and 5 deletions

19
include/TScopedTimer.h Normal file
View File

@@ -0,0 +1,19 @@
#pragma once
#include <chrono>
#include <functional>
#include <string>
class TScopedTimer {
public:
TScopedTimer();
TScopedTimer(const std::string& Name);
TScopedTimer(std::function<void(size_t)> OnDestroy);
~TScopedTimer();
std::function<void(size_t /* time_ms */)> OnDestroy { nullptr };
private:
std::chrono::high_resolution_clock::time_point mStartTime;
std::string Name;
};