#include <scoped_timer.h>
Public Member Functions | |
double | elapsed () |
Get time since construction. | |
ScopedTimer (const char *name, bool only_for_logging=true, bool unconditional_logging=false) | |
Log time elapsed at destruction (if > min_time_reported param or unconditional_logging = true) | |
~ScopedTimer () | |
Log time since construction (if > min_time_reported param) | |
Private Attributes | |
const char * | name |
struct timespec | start |
bool | unconditional_triggering |
Class that outputs the time since construction on destruction. Depends on the loggerlevel. If ROSCONSOLE_MIN_SEVERITY is set above INFO, only Timers with unconditional_logging=true will be active (and output on WARN level).
Definition at line 9 of file scoped_timer.h.
ScopedTimer::ScopedTimer | ( | const char * | name, |
bool | only_for_logging = true , |
||
bool | unconditional_logging = false |
||
) |
Log time elapsed at destruction (if > min_time_reported param or unconditional_logging = true)
Definition at line 5 of file scoped_timer.cpp.
Log time since construction (if > min_time_reported param)
Definition at line 22 of file scoped_timer.cpp.
double ScopedTimer::elapsed | ( | ) |
Get time since construction.
Definition at line 16 of file scoped_timer.cpp.
const char* ScopedTimer::name [private] |
Definition at line 19 of file scoped_timer.h.
struct timespec ScopedTimer::start [private] |
Definition at line 18 of file scoped_timer.h.
bool ScopedTimer::unconditional_triggering [private] |
Definition at line 20 of file scoped_timer.h.