HDK
|
#include <Timer.h>
Public Types | |
using | clock = std::chrono::high_resolution_clock |
Public Member Functions | |
ScopedTimer (double *externalCounter=nullptr) | |
~ScopedTimer () | |
double | elapsedTime () |
Return the elapsed time in seconds since our start time. More... | |
void | startTimer () |
Activate the timer, and set our start time to the current moment. More... | |
void | endTimer () |
Deactivate the timer, and add the elapsed time to our external counter. More... | |
ScopedTimer (Timer &t) | |
~ScopedTimer () | |
void | start () |
void | stop () |
void | reset () |
Protected Attributes | |
bool | _active |
double * | _externalCounter |
std::chrono::time_point< clock > | _startTime |
Helper class that starts and stops a timer when the ScopedTimer goes in and out of scope.
A class for scoped event timing
using ScopedTimer::clock = std::chrono::high_resolution_clock |
ScopedTimer::ScopedTimer | ( | double * | externalCounter = nullptr | ) |
ScopedTimer::~ScopedTimer | ( | ) |
|
inline |
|
inline |
double ScopedTimer::elapsedTime | ( | ) |
Return the elapsed time in seconds since our start time.
void ScopedTimer::endTimer | ( | ) |
Deactivate the timer, and add the elapsed time to our external counter.
|
inline |
void ScopedTimer::startTimer | ( | ) |
Activate the timer, and set our start time to the current moment.
|
inline |
|
protected |