1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-07-19 11:18:00 +02:00

rwgame: Print gamefiles load time on startup.

This commit is contained in:
Christoph Heiss 2020-05-15 16:50:30 +02:00 committed by Anonymous Maarten
parent a43d241fda
commit 7d73e199c8

View File

@ -26,6 +26,7 @@
#include <objects/VehicleObject.hpp>
#include <boost/algorithm/string/predicate.hpp>
#include <chrono>
#include <functional>
#include <iomanip>
#include <iostream>
@ -59,6 +60,7 @@ RWGame::RWGame(Logger& log, const std::optional<RWArgConfigLayer> &args)
RW_PROFILE_THREAD("Main");
RW_TIMELINE_ENTER("Startup", MP_YELLOW);
auto loadTimeStart = std::chrono::steady_clock::now();
bool newgame = false;
bool test = false;
std::optional<std::string> startSave;
@ -127,6 +129,11 @@ RWGame::RWGame(Logger& log, const std::optional<RWArgConfigLayer> &args)
}
});
auto loadTimeEnd = std::chrono::steady_clock::now();
auto loadTime =
std::chrono::duration_cast<std::chrono::milliseconds>(loadTimeEnd - loadTimeStart);
log.info("Game", "Loading took " + std::to_string(loadTime.count()) + " ms");
log.info("Game", "Started");
RW_TIMELINE_LEAVE("Startup");
}