ZeroErr
载入中...
搜索中...
未找到
benchmark.h 文件参考
#include "zeroerr/internal/config.h"
#include <chrono>
#include <cstdint>
#include <string>
#include <vector>
benchmark.h 的引用(Include)关系图:
此图展示该文件直接或间接的被哪些文件引用了:

浏览源代码.

struct  zeroerr::PerfCountSet< T >
 PerfCountSet is a set of performance counters. 更多...
 
struct  zeroerr::PerformanceCounter
 PerformanceCounter is a class to measure the performance of a function. 更多...
 
struct  zeroerr::BenchResult
 BenchResult is a result of running the benchmark. 更多...
 
struct  zeroerr::Benchmark
 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. 更多...
 

命名空间

namespace  zeroerr
 
namespace  zeroerr::detail
 

宏定义

#define ZEROERR_CREATE_BENCHMARK_FUNC(function, name, ...)
 
#define BENCHMARK(name, ...)    ZEROERR_CREATE_BENCHMARK_FUNC(ZEROERR_NAMEGEN(_zeroerr_benchmark), name, __VA_ARGS__)
 

类型定义

using zeroerr::Clock = std::conditional< std::chrono::high_resolution_clock::is_steady, std::chrono::high_resolution_clock, std::chrono::steady_clock >::type
 

函数

BenchStatezeroerr::createBenchState (Benchmark &benchmark)
 
void zeroerr::destroyBenchState (BenchState *state)
 
size_t zeroerr::getNumIter (BenchState *state)
 
void zeroerr::runIteration (BenchState *state)
 
void zeroerr::moveResult (BenchState *state, std::string name)
 
template<typename T >
void zeroerr::detail::doNotOptimizeAway (const T &val)
 
template<typename T >
void zeroerr::detail::doNotOptimizeAway (T &val)
 
template<typename Arg >
void zeroerr::doNotOptimizeAway (Arg &&arg)
 Makes sure none of the given arguments are optimized away by the compiler.
 

宏定义说明

◆ BENCHMARK

#define BENCHMARK (   name,
  ... 
)     ZEROERR_CREATE_BENCHMARK_FUNC(ZEROERR_NAMEGEN(_zeroerr_benchmark), name, __VA_ARGS__)

◆ ZEROERR_CREATE_BENCHMARK_FUNC

#define ZEROERR_CREATE_BENCHMARK_FUNC (   function,
  name,
  ... 
)
值:
static void function(zeroerr::TestContext*); \
static zeroerr::detail::regTest ZEROERR_NAMEGEN(_zeroerr_reg)( \
{name, __FILE__, __LINE__, function, {__VA_ARGS__}}, zeroerr::TestType::bench); \
static void function(ZEROERR_UNUSED(zeroerr::TestContext* _ZEROERR_TEST_CONTEXT))
TestContext is a class that holds the test results and reporter context. There are 8 different matric...
Definition unittest.h:70
#define ZEROERR_NAMEGEN(x)
Definition config.h:104
#define ZEROERR_UNUSED(x)
Definition config.h:341
@ bench
Definition unittest.h:267
regTest is a class that is used to register the test case. It will be used as global variables and th...
Definition unittest.h:275