Quad-SDK
|
#include <function_timer.h>
Public Member Functions | |
FunctionTimer (const char *function_name) | |
Constructor for FunctionTimer Class. | |
double | reportSilent () |
Report the statistics without printing to the terminal. | |
double | reportStatistics () |
Report the statistics to the terminal. | |
double | reportStatistics (int n) |
Report the averaged statistics to the terminal over a given number of iterations. | |
void | reportAndRestart () |
Report the statistics to the terminal and restart the clock. | |
A lightweight class for measuring and reporting the duration of functions calls
FunctionTimer keeps track of the amount of time elapsed between start and stop calls, and reporting this along with the name of the function. For some reason the logic in this class takes about 1e-7 s to run so timing functions faster than that will yield inaccurate solutions compared to standard steady clock methods. For functions that take longer than 1e-6 s it should work.
|
inline |
Constructor for FunctionTimer Class.
|
inline |
Report the statistics without printing to the terminal.
|
inline |
Report the averaged statistics to the terminal over a given number of iterations.
[in] | n | Number of iterations executed during elapsed time (used for averaging) |