JODA
0.13.1 (59b41972)
JSON On-Demand Analysis
|
#include <Timer.h>
Public Member Functions | |
Timer () | |
void | start () |
void | stop () |
double | durationSeconds () |
std::string | toString () |
void | log (const std::string &what, const std::string &part) |
std::string | toHumanDuration () const |
Protected Member Functions | |
std::chrono::time_point< std::chrono::system_clock > | now () |
Protected Attributes | |
std::chrono::time_point< std::chrono::system_clock > | startTime |
std::chrono::time_point< std::chrono::system_clock > | endTime |
A timer that can be started and stopped multiple times and replaces the previous runtime.
Timer::Timer | ( | ) |
Creates a new instance of the timer and immediately starts it.
double Timer::durationSeconds | ( | ) |
Returns the total duration of the timer in seconds.
void Timer::log | ( | const std::string & | what, |
const std::string & | part | ||
) |
Loggs the runtime to GLOG with an string tag and description "[<part>] <what> took <time>"
what | the description of what was measured |
what | the description of what was measured |
|
protected |
void Timer::start | ( | ) |
Start the timer, the previous runtime (if exists) is replaced.
void Timer::stop | ( | ) |
Stopps the timer
std::string Timer::toHumanDuration | ( | ) | const |
Creates a human readable string representation of the duration in the format: "xh xm xs xms"
std::string Timer::toString | ( | ) |
Creates a string representation of the duration
|
protected |
|
protected |