|
HART
0.2.0
High level Audio Regression and Testing
|
Helper class for measuring duration of some block of code over multiple runs. More...
#include <hart_time_it.hpp>
Public Member Functions | |
| TimeIt (size_t numRuns) | |
| Creates a new TimeIt instance. | |
| template<typename ReducerType > | |
| auto | result (ReducerType &&reducer) const -> ReducerResultType< ReducerType, std::vector< double >::const_iterator > |
| Get the result of the timing measurement. | |
Helper class for measuring duration of some block of code over multiple runs.
Don't instantiate this class directly, it's intended to be created via HART_TIME_IT() macro
Definition at line 73 of file hart_time_it.hpp.
|
inline |
Creates a new TimeIt instance.
| numRuns | Number of times to run the measured block of code |
Definition at line 78 of file hart_time_it.hpp.
|
inline |
Get the result of the timing measurement.
Internally, it stores a list of durations for each run. You're expected to choose what to do with this value by providing a reducer instance like hart::mean(), hart::max(). If you want to get the raw list of values, you can use hart::collect().
| reducer | Callable object that accepts a pair of std::vector iterators (begin and end). You'll probably want to use one of the HART's built-in reducers, see Reducers. |
Definition at line 98 of file hart_time_it.hpp.