mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2025-01-06 01:23:35 +08:00
97a8c5d60b
* feat(Spoofing): add spoofing * feat(Spoofing): prepare code for player attach * remove(PlayerAttach): isn't going to work due to netsync architecture * fix(GUI): fix scaling * feat(Project): add clang-format file * feat(Classes): update classes * fix(BlackHole): remove unnecessary cleanup * fix(Formatting): fix formatting for initializer lists * feat(clang-format): Set tab width and 1 space before comment Co-authored-by: Yimura <24669514+Yimura@users.noreply.github.com>
36 lines
789 B
C++
36 lines
789 B
C++
#pragma once
|
|
|
|
#include "logger.hpp"
|
|
|
|
namespace big
|
|
{
|
|
using namespace std::chrono;
|
|
class benchmark
|
|
{
|
|
public:
|
|
explicit benchmark(std::string name = "") :
|
|
m_start(high_resolution_clock::now()),
|
|
m_name(name)
|
|
{
|
|
}
|
|
|
|
void get_runtime()
|
|
{
|
|
auto now = high_resolution_clock::now();
|
|
auto milliseconds_elapsed = duration_cast<milliseconds>(now - m_start);
|
|
auto microseconds_elapsed = duration_cast<microseconds>(now - m_start);
|
|
LOG(INFO) << m_name << " finished with a resulting time of: " << milliseconds_elapsed.count() << "ms "
|
|
<< microseconds_elapsed.count() % 1000 << "us";
|
|
}
|
|
|
|
void reset()
|
|
{
|
|
m_start = high_resolution_clock::now();
|
|
}
|
|
|
|
private:
|
|
high_resolution_clock::time_point m_start;
|
|
std::string m_name;
|
|
};
|
|
}
|