15 lines
297 B
C++
15 lines
297 B
C++
#pragma once
|
|
#include <chrono>
|
|
|
|
class Timer {
|
|
public:
|
|
void start();
|
|
void stop();
|
|
long long elapsedMs() const;
|
|
|
|
private:
|
|
std::chrono::time_point<std::chrono::high_resolution_clock> startTime;
|
|
std::chrono::time_point<std::chrono::high_resolution_clock> endTime;
|
|
bool running = false;
|
|
};
|