mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-04-22 16:06:43 +00:00
Add ScopedTimer, Remove some comments
This commit is contained in:
19
include/TScopedTimer.h
Normal file
19
include/TScopedTimer.h
Normal 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;
|
||||
};
|
||||
Reference in New Issue
Block a user