#include "testing.hh"
Public Member Functions | |
template<typename Callee > | |
double | benchmark (Callee callee) |
double | max_elapsed () const |
double | min_elapsed () const |
int64 | n_reps () const |
double | test_elapsed () const |
Timer (double deadline_in_secs=0) | |
virtual | ~Timer () |
Class for profiling benchmark tests. UseCase: Benchmarking function implementations, e.g. to compare sorting implementations.
|
explicit |
Create a Timer() instance, specifying an optional upper bound for test durations.
|
virtual |
int64 n_reps | ( | ) | const |
Number of benchmark repetitions to execute.
double test_elapsed | ( | ) | const |
Seconds spent in benchmark()
double min_elapsed | ( | ) | const |
Minimum time benchmarked for a callee() call.
double max_elapsed | ( | ) | const |
Maximum time benchmarked for a callee() call.
double benchmark | ( | Callee | callee | ) |
callee | A callable function or object. Method to benchmark the execution time of callee. |