6 #ifndef RAVEN_BENCH_BENCH_H 7 #define RAVEN_BENCH_BENCH_H 14 #include <boost/preprocessor/cat.hpp> 15 #include <boost/preprocessor/stringize.hpp> 53 State(std::string _name,
double _maxElapsed) : name(_name), maxElapsed(_maxElapsed), count(0) {
54 minTime = std::numeric_limits<double>::max();
55 maxTime = std::numeric_limits<double>::min();
56 minCycles = std::numeric_limits<uint64_t>::max();
57 maxCycles = std::numeric_limits<uint64_t>::min();
68 static BenchmarkMap &benchmarks();
73 static void RunAll(
double elapsedTimeForOne=1.0);
78 #define BENCHMARK(n) \ 79 benchmark::BenchRunner BOOST_PP_CAT(bench_, BOOST_PP_CAT(__LINE__, n))(BOOST_PP_STRINGIZE(n), n); 81 #endif // RAVEN_BENCH_BENCH_H
State(std::string _name, double _maxElapsed)
std::map< std::string, BenchFunction > BenchmarkMap
std::function< void(State &)> BenchFunction