1#include "benchmark/benchmark.h"
2
3void BM_empty(benchmark::State& state) {
4 for (auto _ : state) {
5 auto iterations = double(state.iterations()) * double(state.iterations());
6 benchmark::DoNotOptimize(value&: iterations);
7 }
8}
9BENCHMARK(BM_empty);
10

Provided by KDAB

Privacy Policy
Update your C++ knowledge – Modern C++11/14/17 Training
Find out more

source code of third-party/benchmark/test/link_main_test.cc