Lunatic: slightly tweak the event/actor times printout when exiting.

git-svn-id: https://svn.eduke32.com/eduke32@4178 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2013-11-28 21:18:00 +00:00
parent cc1574464b
commit f26663a9dc

View file

@ -153,6 +153,7 @@ finish:
char buf[32]; char buf[32];
int32_t maxlen = 0; int32_t maxlen = 0;
int32_t haveev=0, haveac=0;
for (i=0; i<MAXEVENTS; i++) for (i=0; i<MAXEVENTS; i++)
{ {
@ -161,13 +162,17 @@ finish:
maxlen = max(len, maxlen); maxlen = max(len, maxlen);
} }
OSD_Printf("{\n {\n");
OSD_Printf(" -- event times, [event]={ total calls, total time [ms], mean time/call [us] }\n");
for (i=0; i<MAXEVENTS; i++) for (i=0; i<MAXEVENTS; i++)
if (g_eventCalls[i]) if (g_eventCalls[i])
{ {
int32_t n=Bsprintf(buf, "%s", EventNames[i]+nn); int32_t n=Bsprintf(buf, "%s", EventNames[i]+nn);
if (!haveev)
{
haveev = 1;
OSD_Printf("\n -- event times: [event]={ total calls, total time [ms], mean time/call [us] }\n");
}
for (; n<maxlen; n++) for (; n<maxlen; n++)
buf[n] = ' '; buf[n] = ' ';
buf[maxlen] = 0; buf[maxlen] = 0;
@ -177,16 +182,21 @@ finish:
1000*g_eventTotalMs[i]/g_eventCalls[i]); 1000*g_eventTotalMs[i]/g_eventCalls[i]);
} }
OSD_Printf(" },\n\n {\n");
OSD_Printf(" -- actor times, [tile]={ total calls, total time [ms], {min,mean,max} time/call [us] }\n");
for (i=0; i<MAXTILES; i++) for (i=0; i<MAXTILES; i++)
if (g_actorCalls[i]) if (g_actorCalls[i])
{
if (!haveac)
{
haveac = 1;
OSD_Printf("\n -- actor times: [tile]={ total calls, total time [ms], {min,mean,max} time/call [us] }\n");
}
OSD_Printf(" [%5d]={ %8d, %9.3f, %9.3f, %9.3f, %9.3f },\n", OSD_Printf(" [%5d]={ %8d, %9.3f, %9.3f, %9.3f, %9.3f },\n",
i, g_actorCalls[i], g_actorTotalMs[i], i, g_actorCalls[i], g_actorTotalMs[i],
1000*g_actorMinMs[i], 1000*g_actorMinMs[i],
1000*g_actorTotalMs[i]/g_actorCalls[i], 1000*g_actorTotalMs[i]/g_actorCalls[i],
1000*g_actorMaxMs[i]); 1000*g_actorMaxMs[i]);
OSD_Printf(" },\n}\n"); }
} }
} }