diff --git a/source/blood/src/blood.cpp b/source/blood/src/blood.cpp index 26f8cbfa6..b3bbc453d 100644 --- a/source/blood/src/blood.cpp +++ b/source/blood/src/blood.cpp @@ -720,10 +720,10 @@ void GameInterface::app_init() loaddefinitionsfile(BLOODWIDESCREENDEF); const char* defsfile = G_DefFile(); - uint32_t stime = timerGetTicks(); + uint32_t stime = I_msTime(); if (!loaddefinitionsfile(defsfile)) { - uint32_t etime = timerGetTicks(); + uint32_t etime = I_msTime(); Printf(PRINT_NONOTIFY, "Definitions file \"%s\" loaded in %d ms.\n", defsfile, etime - stime); } powerupInit(); diff --git a/source/build/include/common.h b/source/build/include/common.h index 53beadf2a..4528d05a3 100644 --- a/source/build/include/common.h +++ b/source/build/include/common.h @@ -65,8 +65,8 @@ int32_t getatoken(scriptfile *sf, const tokenlist *tl, int32_t ntokens); void COMMON_clearbackground(int32_t numcols, int32_t numrows); // timer defs for profiling function chunks the simple way -#define EDUKE32_TMRDEF int32_t t[20], ti=0; const char *tmrstr=__func__; fprintf(stderr,"%s\n",tmrstr); t[ti++]=timerGetTicks(); -#define EDUKE32_TMRTIC t[ti++]=timerGetTicks() +#define EDUKE32_TMRDEF int32_t t[20], ti=0; const char *tmrstr=__func__; fprintf(stderr,"%s\n",tmrstr); t[ti++]=I_msTime(); +#define EDUKE32_TMRTIC t[ti++]=I_msTime() #define EDUKE32_TMRPRN do { int ii=0; fprintf(stderr,"%s: ",tmrstr); for (ii=1; iiinitstate <= 0) // not inited or error return 1; - t[0] = timerGetTicks(); + t[0] = I_msTime(); if (codec->decstate == 0) // first time / begin { @@ -289,7 +289,7 @@ read_ivf_frame: return 5; } - t[1] = timerGetTicks(); + t[1] = I_msTime(); uint8_t *const dstpic = codec->pic; @@ -331,7 +331,7 @@ read_ivf_frame: dstpic[((wy1 + x + 1) << 2) + 2] = v; } } - t[2] = timerGetTicks(); + t[2] = I_msTime(); codec->sumtimes[0] += t[1]-t[0]; codec->sumtimes[1] += t[2]-t[1]; @@ -369,7 +369,7 @@ void animvpx_restore_glstate(void) int32_t animvpx_render_frame(animvpx_codec_ctx *codec, double animvpx_aspect) { - int32_t t = timerGetTicks(); + int32_t t = I_msTime(); if (codec->initstate <= 0) // not inited or error return 1; @@ -404,7 +404,7 @@ int32_t animvpx_render_frame(animvpx_codec_ctx *codec, double animvpx_aspect) DrawTexture(twod, vpxtex[which], screen->GetWidth() / 2 - int(x), screen->GetHeight()/2 - int(y), DTA_DestWidth, 2*int(x), DTA_DestHeight, 2*int(y), DTA_Masked, false, DTA_KeepRatio, true, DTA_LegacyRenderStyle, STYLE_Normal, TAG_DONE); - t = timerGetTicks()-t; + t = I_msTime()-t; codec->sumtimes[2] += t; codec->maxtimes[2] = max(codec->maxtimes[2], t); codec->numframes++; diff --git a/source/build/src/engine.cpp b/source/build/src/engine.cpp index 098ce0ecd..42ce85175 100644 --- a/source/build/src/engine.cpp +++ b/source/build/src/engine.cpp @@ -2726,7 +2726,7 @@ void videoNextPage(void) videoShowFrame(0); omdtims = mdtims; - mdtims = timerGetTicks(); + mdtims = I_msTime(); for (native_t i = 0; i < MAXSPRITES + MAXUNIQHUDID; ++i) if ((mdpause && spriteext[i].mdanimtims) || (spriteext[i].flags & SPREXT_NOMDANIM)) diff --git a/source/build/src/timer.cpp b/source/build/src/timer.cpp index 2bc5a91bf..d1033e99f 100644 --- a/source/build/src/timer.cpp +++ b/source/build/src/timer.cpp @@ -14,5 +14,3 @@ EDUKE32_STATIC_ASSERT((steady_clock::period::den/steady_clock::period::num) >= 1 static time_point timerlastsample; static int timerticspersec; - -uint32_t timerGetTicks(void) { return duration_cast(steady_clock::now().time_since_epoch()).count(); } diff --git a/source/exhumed/src/exhumed.cpp b/source/exhumed/src/exhumed.cpp index 7d884a302..8402c6318 100644 --- a/source/exhumed/src/exhumed.cpp +++ b/source/exhumed/src/exhumed.cpp @@ -624,10 +624,10 @@ void GameInterface::app_init() InstallEngine(); const char* defsfile = G_DefFile(); - uint32_t stime = timerGetTicks(); + uint32_t stime = I_msTime(); if (!loaddefinitionsfile(defsfile)) { - uint32_t etime = timerGetTicks(); + uint32_t etime = I_msTime(); Printf("Definitions file \"%s\" loaded in %d ms.\n", defsfile, etime - stime); }