From 6fca2de7f383a253268fbcacadbcafa82b4d8208 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Thu, 22 Apr 2021 18:57:41 +1000 Subject: [PATCH] - Fix clocking of timer when doing cumulative loads in `loaddefinitionsfile()`. --- source/core/defparser.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/core/defparser.cpp b/source/core/defparser.cpp index 020e6026c..d237eab71 100644 --- a/source/core/defparser.cpp +++ b/source/core/defparser.cpp @@ -2126,12 +2126,12 @@ void loaddefinitionsfile(const char* fn, bool cumulative) cycle_t deftimer; deftimer.Reset(); - deftimer.Clock(); auto printtimer = [&](const char* fn) { deftimer.Unclock(); DPrintf(DMSG_SPAMMY, "Definitions file \"%s\" loaded, %f ms.\n", fn, deftimer.TimeMS()); + deftimer.Reset(); }; if (!cumulative) @@ -2140,6 +2140,7 @@ void loaddefinitionsfile(const char* fn, bool cumulative) if (lump >= 0) { Printf(PRINT_NONOTIFY, "Loading \"%s\"\n", fn); + deftimer.Clock(); parseit(lump); printtimer(fn); } @@ -2150,6 +2151,7 @@ void loaddefinitionsfile(const char* fn, bool cumulative) while ((lump = fileSystem.FindLumpFullName(fn, &lastlump)) >= 0) { Printf(PRINT_NONOTIFY, "Loading \"%s\"\n", fileSystem.GetFileFullPath(lump).GetChars()); + deftimer.Clock(); parseit(lump); printtimer(fn); }