App: Print average frame-time on exit
This commit is contained in:
@@ -171,7 +171,9 @@ int Application::run()
|
||||
constexpr glm::mat4 matIdentity { 1.0f };
|
||||
constexpr TransformComponent transformIdentity;
|
||||
|
||||
// m_window->setVSync(false);
|
||||
double gametime = 0;
|
||||
uint64_t frames = 0;
|
||||
|
||||
while (!m_window->shouldClose()) {
|
||||
|
||||
float time = Time::time();
|
||||
@@ -179,6 +181,9 @@ int Application::run()
|
||||
m_lastFrameTime = time;
|
||||
// ruc::debug("Frametime {}ms", deltaTime * 1000);
|
||||
|
||||
gametime += deltaTime;
|
||||
frames++;
|
||||
|
||||
// ---------------------------------
|
||||
// Update
|
||||
|
||||
@@ -224,6 +229,8 @@ int Application::run()
|
||||
|
||||
ruc::debug("Application shutdown");
|
||||
|
||||
ruc::debug("Average frametime: {:.2f}ms", (gametime / frames) * 1000);
|
||||
|
||||
return m_status;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user