File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change 18
18
/*
19
19
* Usage:
20
20
21
- static void CODE_TO_TIME (benchmark::Bench& bench)
21
+ static void NameOfYourBenchmarkFunction (benchmark::Bench& bench)
22
22
{
23
- ... do any setup needed...
24
- nanobench::Config().run([&] {
25
- ... do stuff you want to time...
23
+ ...do any setup needed...
24
+
25
+ bench.run([&] {
26
+ ...do stuff you want to time; refer to src/bench/nanobench.h
27
+ for more information and the options that can be passed here...
26
28
});
27
- ... do any cleanup needed...
29
+
30
+ ...do any cleanup needed...
28
31
}
29
32
30
- BENCHMARK(CODE_TO_TIME );
33
+ BENCHMARK(NameOfYourBenchmarkFunction );
31
34
32
35
*/
33
36
@@ -55,7 +58,8 @@ class BenchRunner
55
58
56
59
static void RunAll (const Args& args);
57
60
};
58
- }
61
+ } // namespace benchmark
62
+
59
63
// BENCHMARK(foo) expands to: benchmark::BenchRunner bench_11foo("foo", foo);
60
64
#define BENCHMARK (n ) \
61
65
benchmark::BenchRunner PASTE2 (bench_, PASTE2(__LINE__, n))(STRINGIZE(n), n);
You can’t perform that action at this time.
0 commit comments