Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
Catch::BenchmarkLooper Class Reference

#include <catch_benchmark.h>

Public Member Functions

 BenchmarkLooper (StringRef name)
 
 operator bool ()
 
void increment ()
 
void reportStart ()
 
auto needsMoreIterations () -> bool
 
 BenchmarkLooper (StringRef name)
 
 operator bool ()
 
void increment ()
 
void reportStart ()
 
auto needsMoreIterations () -> bool
 

Detailed Description

Definition at line 2572 of file catch.hpp.

Constructor & Destructor Documentation

◆ BenchmarkLooper() [1/2]

Catch::BenchmarkLooper::BenchmarkLooper ( StringRef name)
inline

Definition at line 30 of file catch_benchmark.h.

31 : m_name( name ),
32 m_resolution( getResolution() )
33 {
35 m_timer.start();
36 }
std::string name
Here is the call graph for this function:

◆ BenchmarkLooper() [2/2]

Catch::BenchmarkLooper::BenchmarkLooper ( StringRef name)
inline

Definition at line 2583 of file catch.hpp.

2584 : m_name( name ),
2585 m_resolution( getResolution() )
2586 {
2587 reportStart();
2588 m_timer.start();
2589 }
Here is the call graph for this function:

Member Function Documentation

◆ increment() [1/2]

void Catch::BenchmarkLooper::increment ( )
inline

Definition at line 44 of file catch_benchmark.h.

44 {
45 ++m_count;
46 }

◆ increment() [2/2]

void Catch::BenchmarkLooper::increment ( )
inline

Definition at line 2597 of file catch.hpp.

2597 {
2598 ++m_count;
2599 }

◆ needsMoreIterations() [1/2]

auto Catch::BenchmarkLooper::needsMoreIterations ( ) -> bool

Definition at line 23 of file catch_benchmark.cpp.

23 {
24 auto elapsed = m_timer.getElapsedNanoseconds();
25
26 // Exponentially increasing iterations until we're confident in our timer resolution
27 if( elapsed < m_resolution ) {
28 m_iterationsToRun *= 10;
29 return true;
30 }
31
32 getResultCapture().benchmarkEnded( { { m_name }, m_count, elapsed } );
33 return false;
34 }
auto getElapsedNanoseconds() const -> uint64_t
IResultCapture & getResultCapture()
virtual void benchmarkEnded(BenchmarkStats const &stats)=0
Here is the call graph for this function:
Here is the caller graph for this function:

◆ needsMoreIterations() [2/2]

auto Catch::BenchmarkLooper::needsMoreIterations ( ) -> bool

◆ operator bool() [1/2]

Catch::BenchmarkLooper::operator bool ( )
inlineexplicit

Definition at line 38 of file catch_benchmark.h.

38 {
39 if( m_count < m_iterationsToRun )
40 return true;
41 return needsMoreIterations();
42 }
auto needsMoreIterations() -> bool
Here is the call graph for this function:

◆ operator bool() [2/2]

Catch::BenchmarkLooper::operator bool ( )
inlineexplicit

Definition at line 2591 of file catch.hpp.

2591 {
2592 if( m_count < m_iterationsToRun )
2593 return true;
2594 return needsMoreIterations();
2595 }

◆ reportStart() [1/2]

void Catch::BenchmarkLooper::reportStart ( )

Definition at line 20 of file catch_benchmark.cpp.

20 {
21 getResultCapture().benchmarkStarting( { m_name } );
22 }
virtual void benchmarkStarting(BenchmarkInfo const &info)=0
Here is the call graph for this function:
Here is the caller graph for this function:

◆ reportStart() [2/2]

void Catch::BenchmarkLooper::reportStart ( )

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