![]() |
aGrUM
0.20.3
a C++ library for (probabilistic) graphical models
|
Class used to compute response times for benchmark purposesThis class represents a classic timer, it starts in the constructor, you can reset it with method reset() and you can get the delta time with the method step(). More...
#include <agrum/tools/core/timer.h>
Public Member Functions | |
Constructors / Destructors | |
Timer () | |
Default constructor (launching the timer). More... | |
Timer (const Timer &timer) | |
Copy constructor. More... | |
~Timer () | |
Destructor. More... | |
Operators | |
Timer & | operator= (const Timer &timer) |
Copy operator. More... | |
Timer manipulation | |
void | reset () |
Reset the timer. More... | |
double | pause () |
Pause the timer and return the delta (. More... | |
double | resume () |
Resume the timer and return the delta (. More... | |
double | step () const |
Returns the delta time between now and the last reset() call (or the constructor). More... | |
Protected Attributes | |
std::chrono::high_resolution_clock::time_point | start_ |
Time of the last call to reset() or the constructor. More... | |
std::chrono::high_resolution_clock::time_point | pause_ |
Time of the last call to pause(). More... | |
bool | sleeping_ |
False if running. More... | |
Class used to compute response times for benchmark purposes
This class represents a classic timer, it starts in the constructor, you can reset it with method reset() and you can get the delta time with the method step().
This class uses double for representing time data, all the values are in seconds, and the precision is about 0.001 s
gum::Timer::Timer | ( | ) |
Default constructor (launching the timer).
Definition at line 37 of file timer.cpp.
References gum::Set< Key, Alloc >::emplace().
gum::Timer::Timer | ( | const Timer & | timer | ) |
Copy constructor.
timer | The gum::Timer to copy. |
Definition at line 42 of file timer.cpp.
References gum::Set< Key, Alloc >::emplace().
gum::Timer::~Timer | ( | ) |
Destructor.
Definition at line 47 of file timer.cpp.
References gum::Set< Key, Alloc >::emplace().
Copy operator.
timer | The gum::Timer to copy. |
Definition at line 52 of file timer.cpp.
References gum::Set< Key, Alloc >::emplace().
INLINE double gum::Timer::pause | ( | ) |
Pause the timer and return the delta (.
Definition at line 52 of file timer_inl.h.
References gum::Set< Key, Alloc >::emplace().
INLINE void gum::Timer::reset | ( | ) |
Reset the timer.
Definition at line 31 of file timer_inl.h.
References gum::Set< Key, Alloc >::emplace().
INLINE double gum::Timer::resume | ( | ) |
Resume the timer and return the delta (.
Definition at line 62 of file timer_inl.h.
References gum::Set< Key, Alloc >::emplace().
INLINE double gum::Timer::step | ( | ) | const |
Returns the delta time between now and the last reset() call (or the constructor).
Definition at line 41 of file timer_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
protected |
|
protected |