MCPcopy Create free account
hub / github.com/dds-bridge/dds / PrintStats

Method PrintStats

library/src/system/timer_list.cpp:77–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75
76
77void TimerList::PrintStats(ofstream& fout) const
78{
79 if (! TimerList::Used())
80 return;
81
82 // Approximate the exclusive times of each function.
83 // The ab_search_*() functions are recursively nested,
84 // so subtract out the one below.
85 // The other ones are subtracted out based on knowledge
86 // of the functions.
87
88 TimerGroup ABGroup;
89 ABGroup = timerGroups[0];
90 ABGroup.Differentiate();
91 for (unsigned g = 1; g < TIMER_NO_SIZE; g++)
92 ABGroup -= timerGroups[g];
93
94 Timer ABTotal;
95 ABGroup.SetNames("AB");
96 ABGroup.Sum(ABTotal);
97 ABTotal.SetName("Sum");
98
99 Timer sumTotal = ABTotal;
100 for (unsigned g = 1; g < TIMER_NO_SIZE; g++)
101 {
102 Timer t;
103 timerGroups[g].Sum(t);
104 sumTotal += t;
105 }
106
107 fout << timerGroups[0].Header();
108 fout << ABGroup.SumLine(sumTotal);
109 for (unsigned g = 1; g < TIMER_NO_SIZE; g++)
110 fout << timerGroups[g].SumLine(sumTotal);
111 fout << timerGroups[0].DashLine();
112 fout << sumTotal.SumLine(sumTotal) << endl;
113
114 if (ABGroup.Used())
115 {
116 fout << ABGroup.Header();
117 fout << ABGroup.TimerLines(ABTotal);
118 fout << ABGroup.DashLine();
119 fout << ABTotal.SumLine(ABTotal) << endl;
120 }
121
122#ifdef DDS_TIMING_DETAILS
123 fout << timerGroups[0].DetailHeader();
124 for (unsigned g = 0; g < TIMER_NO_SIZE; g++)
125 fout << timerGroups[g].DetailLines();
126 fout << endl;
127#endif
128}
129

Callers

nothing calls this directly

Calls 11

DifferentiateMethod · 0.80
SumMethod · 0.80
SetNameMethod · 0.80
DashLineMethod · 0.80
TimerLinesMethod · 0.80
DetailHeaderMethod · 0.80
DetailLinesMethod · 0.80
SetNamesMethod · 0.45
HeaderMethod · 0.45
SumLineMethod · 0.45
UsedMethod · 0.45

Tested by

no test coverage detected