mirror of
https://github.com/google/benchmark.git
synced 2024-12-26 20:40:21 +08:00
Correct typo in sample code for range-based for loop. (#458)
This commit is contained in:
parent
cacd321808
commit
2fc2ea0e45
@ -200,11 +200,12 @@ In C++11 mode, a ranged-based for loop should be used in preference to
|
||||
the `KeepRunning` loop for running the benchmarks. For example:
|
||||
|
||||
```c++
|
||||
static void BM_Faste(benchmark::State &st) {
|
||||
static void BM_Fast(benchmark::State &state) {
|
||||
for (auto _ : state) {
|
||||
FastOperation();
|
||||
}
|
||||
}
|
||||
BENCHMARK(BM_Fast);
|
||||
```
|
||||
|
||||
The reason the ranged-based for loop is faster than using `KeepRunning`, is
|
||||
|
Loading…
Reference in New Issue
Block a user