mirror of
https://github.com/google/benchmark.git
synced 2024-12-27 13:00:36 +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:
|
the `KeepRunning` loop for running the benchmarks. For example:
|
||||||
|
|
||||||
```c++
|
```c++
|
||||||
static void BM_Faste(benchmark::State &st) {
|
static void BM_Fast(benchmark::State &state) {
|
||||||
for (auto _ : state) {
|
for (auto _ : state) {
|
||||||
FastOperation();
|
FastOperation();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
BENCHMARK(BM_Fast);
|
||||||
```
|
```
|
||||||
|
|
||||||
The reason the ranged-based for loop is faster than using `KeepRunning`, is
|
The reason the ranged-based for loop is faster than using `KeepRunning`, is
|
||||||
|
Loading…
Reference in New Issue
Block a user