mirror of
https://github.com/rwengine/openrw.git
synced 2024-11-22 02:12:45 +01:00
rwgame: Print gamefiles load time on startup.
This commit is contained in:
parent
a43d241fda
commit
7d73e199c8
@ -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");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user