profiler.h Source File
LibRPA
|
profiler.h
Go to the documentation of this file.
40 Timer(): ncalls(0), clock_start(0), wt_start(0), cpu_time_accu(0), wall_time_accu(0), cpu_time_last(0), wall_time_last(0) {}
A simple profiler object to record timing of code snippet runs in the program.
Definition: profiler.h:17
static double get_wall_time_last(const char *tname) noexcept
Get wall time of last call of timer.
Definition: profiler.cpp:103
static double get_cpu_time_last(const char *tname) noexcept
Get cpu time of last call of timer.
Definition: profiler.cpp:95
static void start(const char *tname, const char *tnote="", int level=-1) noexcept
Start a timer. If the timer is not added before, add it.
Definition: profiler.cpp:72
static void stop(const char *tname) noexcept
Stop a timer and record the timing.
Definition: profiler.cpp:82
static void add(const char *tname, const char *tnote="", int level=-1) noexcept
Add a timer.
Definition: profiler.cpp:44
static void display(int verbose=0) noexcept
Display the current profiling result.
Definition: profiler.cpp:118
static int get_num_timers() noexcept
Get the number of created timers.
Definition: profiler.h:80
Generated by