Anklang 0.3.0-460-gc4ef46ba
ASE — Anklang Sound Engine (C++)

« « « Anklang Documentation
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Ase::Test::Timer Class Reference

#include "testing.hh"

Public Member Functions

 Timer (double deadline_in_secs=0)
 Create a Timer() instance, specifying an optional upper bound for test durations.
 
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.
 
template<typename Callee >
double benchmark (Callee callee)
 

Detailed Description

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

Definition at line 39 of file testing.hh.

Constructor & Destructor Documentation

◆ Timer()

Ase::Test::Timer::Timer ( double  deadline_in_secs = 0)
explicit

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

Definition at line 26 of file testing.cc.

◆ ~Timer()

Ase::Test::Timer::~Timer ( )
virtual

Definition at line 30 of file testing.cc.

Member Function Documentation

◆ benchmark()

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

◆ max_elapsed()

double Ase::Test::Timer::max_elapsed ( ) const

Maximum time benchmarked for a callee() call.

Definition at line 100 of file testing.cc.

References MAX, and std::vector::size().

◆ min_elapsed()

double Ase::Test::Timer::min_elapsed ( ) const

Minimum time benchmarked for a callee() call.

Definition at line 91 of file testing.cc.

References MIN, and std::vector::size().

◆ n_reps()

int64 Ase::Test::Timer::n_reps ( ) const

Number of benchmark repetitions to execute.

Definition at line 52 of file testing.hh.

◆ test_elapsed()

double Ase::Test::Timer::test_elapsed ( ) const

Seconds spent in benchmark()

Definition at line 53 of file testing.hh.


The documentation for this class was generated from the following files: