Slight efficiency update for showFPS. Only need to pull time stamp from realtime clock once per frame.

This commit is contained in:
mjbudd77 2021-09-29 20:23:28 -04:00
parent 6dc5e678c9
commit 2615f9e1e0
1 changed files with 3 additions and 2 deletions

View File

@ -738,10 +738,11 @@ void ShowFPS(void)
{
if(Show_FPS == false)
return;
uint64 da = FCEUD_GetTime() - boop[boopcount];
uint64 ts = FCEUD_GetTime();
uint64 da = ts - boop[boopcount];
char fpsmsg[16];
int booplimit = PAL?50:60;
boop[boopcount] = FCEUD_GetTime();
boop[boopcount] = ts;
sprintf(fpsmsg, "%.1f", (double)booplimit / ((double)da / FCEUD_GetTimeFreq()));
DrawTextTrans(XBuf + ((256 - ClipSidesOffset) - 40) + (FSettings.FirstSLine + 4) * 256, 256, (uint8*)fpsmsg, 0xA0);