hemocell
|
#include <profiler.h>
Public Member Functions | |
Profiler (std::string name_) | |
Profiler (std::string name_, Profiler &parent_) | |
void | start () |
void | stop () |
void | reset () |
void | printStatistics () |
void | outputStatistics () |
void | outputStatistics (int) |
std::chrono::high_resolution_clock::duration | elapsed () |
std::string | elapsed_string () |
Profiler & | operator[] (std::string) |
Profiler & | getCurrent () |
Static Public Member Functions | |
static std::string | toString (std::chrono::high_resolution_clock::duration) |
Private Member Functions | |
void | stop_nowarn () |
template<typename T > | |
void | printStatistics_inner (int level, T &out) |
template<typename T > | |
void | printStatistics_JSON (T &out) |
Private Attributes | |
std::chrono::high_resolution_clock::duration | total_time = std::chrono::high_resolution_clock::duration::zero() |
std::chrono::high_resolution_clock::time_point | start_time = std::chrono::high_resolution_clock::now() |
bool | started = false |
const std::string | name |
std::map< std::string, Profiler > | timers |
Profiler & | parent |
Profiler * | current = this |
Profiler is a class that can be used to track (wall clock) time spent between start and stop invocations. Start and stop can be invoked multiple times per object.
Profiler supports hierarchy, with the [string] operator you can start or retrieve subtimers.
Profiler has a getCurrent() function which can be used to retrieve the last started (sub)timer. With this functionality you can time a function which is called through different paths as different functions in the hierarchy.
hemo::Profiler::Profiler | ( | std::string | name_ | ) |
hemo::Profiler::Profiler | ( | std::string | name_, |
Profiler & | parent_ | ||
) |
std::chrono::high_resolution_clock::duration hemo::Profiler::elapsed | ( | ) |
std::string hemo::Profiler::elapsed_string | ( | ) |
Profiler & hemo::Profiler::getCurrent | ( | ) |
Profiler & hemo::Profiler::operator[] | ( | std::string | name | ) |
void hemo::Profiler::outputStatistics | ( | ) |
void hemo::Profiler::outputStatistics | ( | int | batchsize = INT_MAX | ) |
void hemo::Profiler::printStatistics | ( | ) |
void hemo::Profiler::reset | ( | ) |
void hemo::Profiler::start | ( | ) |
void hemo::Profiler::stop | ( | ) |
|
private |
|
static |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |