Anklang C++ API 0.0.0
Loading...
Searching...
No Matches
Timer

#include "testing.hh"

Public Member Functions

template<typename Callee >
doublebenchmark (Callee callee)
doublemax_elapsed () const
doublemin_elapsed () const
int64n_reps () const
doubletest_elapsed () const
Timer (double deadline_in_secs=0)
virtual~Timer ()

Detailed Description

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

Constructor & Destructor Documentation

Timer()

Timer ( double deadline_in_secs = 0)
explicit

Create a Timer() instance, specifying an optional upper bound for test durations.

~Timer()

~Timer ( )
virtual

Member Function Documentation

n_reps()

int64 n_reps ( ) const

Number of benchmark repetitions to execute.

test_elapsed()

double test_elapsed ( ) const

Seconds spent in benchmark()

min_elapsed()

double min_elapsed ( ) const

Minimum time benchmarked for a callee() call.

max_elapsed()

double max_elapsed ( ) const

Maximum time benchmarked for a callee() call.

benchmark()

template<typename Callee >
double benchmark ( Callee callee)
Parameters
calleeA callable function or object. Method to benchmark the execution time of callee.
Returns
Minimum runtime in seconds,