2023-12-21 18:27:39 +01:00

32 lines
455 B
C++

#pragma once
#include <chrono>
#include <string>
namespace kek {
struct Timings {
float frameTime = 0;
float physicsTime = 0;
float lightingTime = 0;
float renderTime = 0;
float idleTime = 0;
};
class Timer {
private:
std::chrono::high_resolution_clock::time_point start;
public:
void reset();
float elapsedSeconds();
Timer();
};
inline std::string formatSeconds(float seconds) {
return std::format("{:.2f} ms", seconds * 1000);
}
}