comparison base/Profiler.cpp @ 1856:ecd3152750a5

Print results in the opposite order, so most relevant ones are at the end of the listing
author Chris Cannam
date Thu, 14 May 2020 16:35:21 +0100
parents 70e172e6cc59
children
comparison
equal deleted inserted replaced
1855:db489a1ece9b 1856:ecd3152750a5
136 worstmap.insert(TimeRMap::value_type(i->second.second, 136 worstmap.insert(TimeRMap::value_type(i->second.second,
137 i->first)); 137 i->first));
138 } 138 }
139 139
140 140
141 fprintf(stderr, "\nBy number of calls:\n");
142 for (IntRMap::const_iterator i = ncallmap.end(); i != ncallmap.begin(); ) {
143 --i;
144 fprintf(stderr, "%-40s %d\n", i->second, i->first);
145 }
146
147 fprintf(stderr, "\nBy average:\n");
148 for (TimeRMap::const_iterator i = avgmap.end(); i != avgmap.begin(); ) {
149 --i;
150 fprintf(stderr, "%-40s %s ms\n", i->second,
151 (i->first * 1000).toString().c_str());
152 }
153
154 fprintf(stderr, "\nBy worst case:\n");
155 for (TimeRMap::const_iterator i = worstmap.end(); i != worstmap.begin(); ) {
156 --i;
157 fprintf(stderr, "%-40s %s ms\n", i->second,
158 (i->first * 1000).toString().c_str());
159 }
160
141 fprintf(stderr, "\nBy total:\n"); 161 fprintf(stderr, "\nBy total:\n");
142 for (TimeRMap::const_iterator i = totmap.end(); i != totmap.begin(); ) { 162 for (TimeRMap::const_iterator i = totmap.end(); i != totmap.begin(); ) {
143 --i; 163 --i;
144 fprintf(stderr, "%-40s %s ms\n", i->second, 164 fprintf(stderr, "%-40s %s ms\n", i->second,
145 (i->first * 1000).toString().c_str()); 165 (i->first * 1000).toString().c_str());
146 }
147
148 fprintf(stderr, "\nBy average:\n");
149 for (TimeRMap::const_iterator i = avgmap.end(); i != avgmap.begin(); ) {
150 --i;
151 fprintf(stderr, "%-40s %s ms\n", i->second,
152 (i->first * 1000).toString().c_str());
153 }
154
155 fprintf(stderr, "\nBy worst case:\n");
156 for (TimeRMap::const_iterator i = worstmap.end(); i != worstmap.begin(); ) {
157 --i;
158 fprintf(stderr, "%-40s %s ms\n", i->second,
159 (i->first * 1000).toString().c_str());
160 }
161
162 fprintf(stderr, "\nBy number of calls:\n");
163 for (IntRMap::const_iterator i = ncallmap.end(); i != ncallmap.begin(); ) {
164 --i;
165 fprintf(stderr, "%-40s %d\n", i->second, i->first);
166 } 166 }
167 167
168 #endif 168 #endif
169 } 169 }
170 170