#pragma once

#include <chrono>
#include <iomanip>
#include <sstream>
#include <string>

namespace kek {

struct Timings {
	float frameTime = 0;
	float physicsTime = 0;
	float lightingTime = 0;
	float renderTime = 0;
	float swapTime = 0;
};

class Timer {

  private:
	std::chrono::high_resolution_clock::time_point start;

  public:
	void reset();
	float elapsedSeconds();
	Timer();
};

inline std::string formatSeconds(float seconds) {
	std::ostringstream s;
	s << std::fixed << std::setprecision(2) << (seconds * 1000) << " ms";
	return s.str();
}

}
