Skip to content

Commit

Permalink
fix: infra "load took" measurement
Browse files Browse the repository at this point in the history
infra sessions are a bit wacky
  • Loading branch information
ThisAMJ committed Nov 24, 2024
1 parent 4d08918 commit 8b50a00
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/Features/Session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ void Session::Started(bool menu) {
NetMessage::SessionStarted();

g_loadstate = LOAD_END;
this->loadEnd = NOW();
auto time = std::chrono::duration_cast<std::chrono::milliseconds>(this->loadEnd - this->loadStart).count();
console->DevMsg("Load took: %dms\n", time);

this->ResetLoads();
if (menu) {
console->Print("Session started! (menu)\n");
Expand Down Expand Up @@ -268,13 +272,8 @@ void Session::Changed(int state) {
if (state == SIGNONSTATE_FULL) {
timescaleDetect->Spawn();
this->Started();
this->loadEnd = NOW();
engine->demorecorder->queuedCommands.clear();

g_loadstate = LOAD_END;
auto time = std::chrono::duration_cast<std::chrono::milliseconds>(this->loadEnd - this->loadStart).count();
console->DevMsg("Load took: %dms\n", time);

if (sar_load_delay.GetInt()) {
std::this_thread::sleep_for(std::chrono::milliseconds(sar_load_delay.GetInt()));
}
Expand Down

0 comments on commit 8b50a00

Please sign in to comment.