Template Struct measure¶
- Defined in File measure.h
Struct Documentation¶
-
template <typename TimeT = std::chrono::milliseconds>
structmeasure
¶ Utility for time measurements.
Public Static Functions
-
template <typename F, typename... Args>
static autoduration
(F &&function, Args... args)¶ Compute the time spend to execute a function.
Typical Usage:
int aParameter = 1; auto time = shad::measure<std::chrono::seconds>::duration( [](int aParameter) { // ... do what needs to be measured ... }, aParameter); std::cout << "Time spent : " << time.count() << std::endl;
- Return
- the time spent to compute the input function.
- Template Parameters
F
: The type of the function to be computedArgs
: The types of the arguments to be forwarded to the function.
- Parameters
function
: A collable object that will be measuredargs
: The list of args forwarded to the function.
-
template <typename F, typename... Args>