From f5e36dec542a3ca21da9c42c8abf7deb1931c476 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sun, 18 Oct 2020 12:45:19 +0200 Subject: [PATCH] Added an application startup timer as debug logging output. --- es-app/src/main.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/es-app/src/main.cpp b/es-app/src/main.cpp index dd511a4f8..8ecc34f31 100644 --- a/es-app/src/main.cpp +++ b/es-app/src/main.cpp @@ -402,6 +402,7 @@ void onExit() int main(int argc, char* argv[]) { srand((unsigned int)time(nullptr)); + const auto applicationStartTime = std::chrono::system_clock::now(); std::locale::global(std::locale("C")); @@ -604,6 +605,11 @@ int main(int argc, char* argv[]) int lastTime = SDL_GetTicks(); int ps_time = SDL_GetTicks(); + const auto applicationEndTime = std::chrono::system_clock::now(); + + LOG(LogDebug) << "Application startup time: " << + std::chrono::duration_cast + (applicationEndTime - applicationStartTime).count() << " ms"; bool running = true;