MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / PrintPerformanceStats

Method PrintPerformanceStats

src/ifcparse/IfcLogger.cpp:228–248  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

226}
227
228void Logger::PrintPerformanceStats() {
229 std::vector<std::pair<double, std::string>> items;
230 for (auto& stat : performance_statistics_) {
231 items.push_back({stat.second, stat.first});
232 }
233
234 std::sort(items.begin(), items.end());
235 std::reverse(items.begin(), items.end());
236
237 size_t max_size = 0;
238 for (auto& item : items) {
239 if (item.second.size() > max_size) {
240 max_size = item.second.size();
241 }
242 }
243
244 for (auto& item : items) {
245 auto message = item.second + std::string(max_size - item.second.size(), ' ') + ": " + std::to_string(item.first);
246 Message(LOG_PERF, message);
247 }
248}
249
250void Logger::Verbosity(Logger::Severity severity) { verbosity_ = severity; }
251Logger::Severity Logger::Verbosity() { return verbosity_; }

Callers

nothing calls this directly

Calls 7

reverseFunction · 0.85
to_stringFunction · 0.85
MessageClass · 0.85
push_backMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected