mirror of
https://github.com/rwengine/openrw.git
synced 2024-09-03 17:19:46 +02: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 <objects/VehicleObject.hpp>
|
||||||
|
|
||||||
#include <boost/algorithm/string/predicate.hpp>
|
#include <boost/algorithm/string/predicate.hpp>
|
||||||
|
#include <chrono>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
@ -59,6 +60,7 @@ RWGame::RWGame(Logger& log, const std::optional<RWArgConfigLayer> &args)
|
|||||||
RW_PROFILE_THREAD("Main");
|
RW_PROFILE_THREAD("Main");
|
||||||
RW_TIMELINE_ENTER("Startup", MP_YELLOW);
|
RW_TIMELINE_ENTER("Startup", MP_YELLOW);
|
||||||
|
|
||||||
|
auto loadTimeStart = std::chrono::steady_clock::now();
|
||||||
bool newgame = false;
|
bool newgame = false;
|
||||||
bool test = false;
|
bool test = false;
|
||||||
std::optional<std::string> startSave;
|
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");
|
log.info("Game", "Started");
|
||||||
RW_TIMELINE_LEAVE("Startup");
|
RW_TIMELINE_LEAVE("Startup");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user