Added an application startup timer as debug logging output.

This commit is contained in:
Leon Styhre 2020-10-18 12:45:19 +02:00
parent 66bab7386b
commit f5e36dec54

View file

@ -402,6 +402,7 @@ void onExit()
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
srand((unsigned int)time(nullptr)); srand((unsigned int)time(nullptr));
const auto applicationStartTime = std::chrono::system_clock::now();
std::locale::global(std::locale("C")); std::locale::global(std::locale("C"));
@ -604,6 +605,11 @@ int main(int argc, char* argv[])
int lastTime = SDL_GetTicks(); int lastTime = SDL_GetTicks();
int ps_time = SDL_GetTicks(); int ps_time = SDL_GetTicks();
const auto applicationEndTime = std::chrono::system_clock::now();
LOG(LogDebug) << "Application startup time: " <<
std::chrono::duration_cast<std::chrono::milliseconds>
(applicationEndTime - applicationStartTime).count() << " ms";
bool running = true; bool running = true;