Add perfstats for bot ticcmd

Cuz bot ticcmd generation is kinda chunky, and was curious how much time it takes. (It's actually a lot less than I thought ... still pretty hefty though)
This commit is contained in:
Sally Coolatta 2022-03-30 22:38:07 -04:00
parent 46dad4b7dd
commit 85c03a51d6
3 changed files with 7 additions and 0 deletions

View file

@ -5092,6 +5092,8 @@ static void SV_Maketic(void)
{
INT32 i;
ps_botticcmd_time = 0;
for (i = 0; i < MAXPLAYERS; i++)
{
if (!playeringame[i])
@ -5099,7 +5101,9 @@ static void SV_Maketic(void)
if (K_PlayerUsesBotMovement(&players[i]))
{
precise_t t = I_GetPreciseTime();
K_BuildBotTiccmd(&players[i], &netcmds[maketic%BACKUPTICS][i]);
ps_botticcmd_time += I_GetPreciseTime() - t;
continue;
}

View file

@ -46,6 +46,7 @@ static precise_t ps_frametime = 0;
precise_t ps_tictime = 0;
precise_t ps_playerthink_time = 0;
precise_t ps_botticcmd_time = 0;
precise_t ps_thinkertime = 0;
precise_t ps_thlist_times[NUM_THINKERLISTS];
@ -363,6 +364,7 @@ static void M_DrawTickStats(void)
perfstatrow_t extra_thinker_time_row[] = {
{"lthinkf", "LUAh_ThinkFrame:", &ps_lua_thinkframe_time},
{"botcmd ", "Bot logic: ", &ps_botticcmd_time},
{"other ", "Other: ", &extratime},
{0}
};

View file

@ -19,6 +19,7 @@
extern precise_t ps_tictime;
extern precise_t ps_playerthink_time;
extern precise_t ps_botticcmd_time;
extern precise_t ps_thinkertime;
extern precise_t ps_thlist_times[];