Ase::Test::Timer class

Class for profiling benchmark tests. UseCase: Benchmarking function implementations, e.g. to compare sorting implementations.

Constructors, destructors, conversion operators

Timer(double deadline_in_secs = 0) explicit
Create a Timer() instance, specifying an optional upper bound for test durations.

Public functions

template <typename Callee>
auto benchmark(Callee callee) →  double
auto max_elapsed() const →  double
Maximum time benchmarked for a callee() call.
auto min_elapsed() const →  double
Minimum time benchmarked for a callee() call.
auto n_reps() const →  int64
Number of benchmark repetitions to execute.
auto test_elapsed() const →  double
Seconds spent in benchmark()

Function documentation

template <typename Callee>
double Ase::Test::Timer::benchmark(Callee callee)

Parameters
callee A callable function or object. Method to benchmark the execution time of callee.
Returns Minimum runtime in seconds,