Gaia
|
This class allows you to measure a certain amount of time, for instance if you want to know how long the execution of a given function takes. More...
#include <timer.h>
Public Member Functions | |
Timer () | |
The constructor of the class. | |
void | start () |
Starts the timer. More... | |
void | restart () |
Restarts the timer. More... | |
void | stop () |
Stops the timer. | |
void | reset () |
Reset the total to 0. | |
double | elapsed () const |
Returns the cumulative number of seconds elapsed between each call to the start()/stop() pair. More... | |
This class allows you to measure a certain amount of time, for instance if you want to know how long the execution of a given function takes.
Its use is very easy: you create the object, you start it, you stop it, and then you ask it how much time there was between the start and stop calls. You can start it and stop it multiple times; in this case, the result will be the sum of each lapse of time.
double Timer::elapsed | ( | ) | const |
Returns the cumulative number of seconds elapsed between each call to the start()/stop()
pair.
If you didn't call one of these two functions at least once or if the timer is still running, this functions returns 0.
Referenced by gaia2::BaseView< DataSetType, PointType, SearchPointType, DistanceType >::getSearchSpace(), gaia2::BaseView< DataSetType, PointType, SearchPointType, DistanceType >::nnSearch(), restart(), and gaia2::BaseView< DataSetType, PointType, SearchPointType, DistanceType >::validate().
|
inline |
void Timer::start | ( | ) |
Starts the timer.
Total is not reset to 0.
Referenced by gaia2::BaseView< DataSetType, PointType, SearchPointType, DistanceType >::getSearchSpace(), gaia2::BaseView< DataSetType, PointType, SearchPointType, DistanceType >::nnSearch(), restart(), and gaia2::BaseView< DataSetType, PointType, SearchPointType, DistanceType >::validate().