Changeset View
Changeset View
Standalone View
Standalone View
src/bench/bench.h
Show First 20 Lines • Show All 123 Lines • ▼ Show 20 Lines | public: | ||||
void result(const State &state); | void result(const State &state); | ||||
void footer(); | void footer(); | ||||
private: | private: | ||||
std::string m_plotly_url; | std::string m_plotly_url; | ||||
int64_t m_width; | int64_t m_width; | ||||
int64_t m_height; | int64_t m_height; | ||||
}; | }; | ||||
} | } // namespace benchmark | ||||
// BENCHMARK(foo, num_iters_for_one_second) expands to: benchmark::BenchRunner | // BENCHMARK(foo, num_iters_for_one_second) expands to: benchmark::BenchRunner | ||||
// bench_11foo("foo", num_iterations); | // bench_11foo("foo", num_iterations); | ||||
// Choose a num_iters_for_one_second that takes roughly 1 second. The goal is | // Choose a num_iters_for_one_second that takes roughly 1 second. The goal is | ||||
// that all benchmarks should take approximately | // that all benchmarks should take approximately | ||||
// the same time, and scaling factor can be used that the total time is | // the same time, and scaling factor can be used that the total time is | ||||
// appropriate for your system. | // appropriate for your system. | ||||
#define BENCHMARK(n, num_iters_for_one_second) \ | #define BENCHMARK(n, num_iters_for_one_second) \ | ||||
benchmark::BenchRunner BOOST_PP_CAT(bench_, BOOST_PP_CAT(__LINE__, n))( \ | benchmark::BenchRunner BOOST_PP_CAT(bench_, BOOST_PP_CAT(__LINE__, n))( \ | ||||
BOOST_PP_STRINGIZE(n), n, (num_iters_for_one_second)); | BOOST_PP_STRINGIZE(n), n, (num_iters_for_one_second)); | ||||
#endif // BITCOIN_BENCH_BENCH_H | #endif // BITCOIN_BENCH_BENCH_H |