We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 41cbb9f commit 54a017dCopy full SHA for 54a017d
examples/google_benchmark_cmake/main.cpp
@@ -56,7 +56,22 @@ static void BM_memcpy(benchmark::State &state) {
56
delete[] src;
57
delete[] dst;
58
}
59
-
60
BENCHMARK(BM_memcpy)->Range(8, 8 << 10);
61
+static inline int compute_sum(int x) {
62
+ int sum = 0;
63
+ for (int i = 0; i < x; i++) {
64
+ sum += i;
65
+ }
66
+ return sum;
67
+}
68
+
69
+static void BM_inlined_compute_sum(benchmark::State &state) {
70
+ for (auto _ : state) {
71
+ benchmark::DoNotOptimize(compute_sum(1024));
72
+ benchmark::ClobberMemory();
73
74
75
+BENCHMARK(BM_inlined_compute_sum);
76
77
BENCHMARK_MAIN();
0 commit comments