MCPcopy Create free account
hub / github.com/AppleWin/AppleWin / LogPerfTimings

Function LogPerfTimings

source/Core.cpp:104–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102static UINT64 g_timeVideoRefresh = 0;
103
104void LogPerfTimings(void)
105{
106 if (g_timeTotal)
107 {
108 UINT64 cpu = g_timeCpu - g_timeVideo - g_timeMB_Timer;
109 UINT64 video = g_timeVideo + g_timeVideoRefresh;
110 UINT64 spkr = g_timeSpeaker;
111 UINT64 mb = g_timeMB_Timer + g_timeMB_NoTimer;
112 UINT64 audio = spkr + mb;
113 UINT64 other = g_timeTotal - g_timeCpu - g_timeSpeaker - g_timeMB_NoTimer - g_timeVideoRefresh;
114
115 LogOutput("Perf breakdown:\n");
116 LogOutput(". CPU %% = %6.2f\n", (double)cpu / (double)g_timeTotal * 100.0);
117 LogOutput(". Video %% = %6.2f\n", (double)video / (double)g_timeTotal * 100.0);
118 LogOutput("... NTSC %% = %6.2f\n", (double)g_timeVideo / (double)g_timeTotal * 100.0);
119 LogOutput("... refresh %% = %6.2f\n", (double)g_timeVideoRefresh / (double)g_timeTotal * 100.0);
120 LogOutput(". Audio %% = %6.2f\n", (double)audio / (double)g_timeTotal * 100.0);
121 LogOutput("... Speaker %% = %6.2f\n", (double)spkr / (double)g_timeTotal * 100.0);
122 LogOutput("... MB %% = %6.2f\n", (double)mb / (double)g_timeTotal * 100.0);
123 LogOutput(". Other %% = %6.2f\n", (double)other / (double)g_timeTotal * 100.0);
124 LogOutput(". TOTAL %% = %6.2f\n", (double)(cpu+video+audio+other) / (double)g_timeTotal * 100.0);
125 }
126}
127#endif
128
129//===========================================================================

Callers 1

Calls 1

LogOutputFunction · 0.85

Tested by

no test coverage detected