ZeroErr
zeroerr::Benchmark Struct Reference

Benchmark create a core object for configuration of a benchmark. This class is a driver to run multiple times of a benchmark. Each time of a run will generate a row of data. Report will print the data in console. More...

#include <benchmark.h>

Collaboration diagram for zeroerr::Benchmark:

Public Types

using ns = std::chrono::nanoseconds
 
using ms = std::chrono::milliseconds
 
using time = ns
 

Public Member Functions

 Benchmark (std::string title)
 
template<typename Op >
Benchmarkrun (std::string name, Op &&op)
 
template<typename Op >
Benchmarkrun (Op &&op)
 
void report ()
 

Public Attributes

std::string title = "benchmark"
 
const char * op_unit = "op"
 
const char * time_unit = "ns"
 
uint64_t epochs = 10
 
uint64_t warmup = 0
 
uint64_t iter_per_epoch = 0
 
time mMaxEpochTime = ms(100)
 
time mMinEpochTime = ms(1)
 
uint64_t minimalResolutionMutipler = 1000
 
std::vector< BenchResultresult
 

Detailed Description

Benchmark create a core object for configuration of a benchmark. This class is a driver to run multiple times of a benchmark. Each time of a run will generate a row of data. Report will print the data in console.

Member Typedef Documentation

◆ ms

using zeroerr::Benchmark::ms = std::chrono::milliseconds

◆ ns

using zeroerr::Benchmark::ns = std::chrono::nanoseconds

◆ time

Constructor & Destructor Documentation

◆ Benchmark()

zeroerr::Benchmark::Benchmark ( std::string  title)
inline

Member Function Documentation

◆ report()

void zeroerr::Benchmark::report ( )

◆ run() [1/2]

template<typename Op >
Benchmark& zeroerr::Benchmark::run ( Op &&  op)
inline

◆ run() [2/2]

template<typename Op >
Benchmark& zeroerr::Benchmark::run ( std::string  name,
Op &&  op 
)
inline

Member Data Documentation

◆ epochs

uint64_t zeroerr::Benchmark::epochs = 10

◆ iter_per_epoch

uint64_t zeroerr::Benchmark::iter_per_epoch = 0

◆ minimalResolutionMutipler

uint64_t zeroerr::Benchmark::minimalResolutionMutipler = 1000

◆ mMaxEpochTime

time zeroerr::Benchmark::mMaxEpochTime = ms(100)

◆ mMinEpochTime

time zeroerr::Benchmark::mMinEpochTime = ms(1)

◆ op_unit

const char* zeroerr::Benchmark::op_unit = "op"

◆ result

std::vector<BenchResult> zeroerr::Benchmark::result

◆ time_unit

const char* zeroerr::Benchmark::time_unit = "ns"

◆ title

std::string zeroerr::Benchmark::title = "benchmark"

◆ warmup

uint64_t zeroerr::Benchmark::warmup = 0

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