#include "profiler.hpp" #include #include using namespace std; Profiler profiler; void Profiler::record_function_call(const char *function_name) { calls[function_name]++; } void Profiler::reset() { calls.clear(); } void Profiler::print() const { for (auto it = this->calls.begin();it != this->calls.end();it++) { ostringstream out; out << left << setw(25) << it->first << right << setw(5) << it->second; cout << out.str() << endl; } }