Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
benchmark
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
benchmark
Commits
2fc2ea0e
Commit
2fc2ea0e
authored
Oct 16, 2017
by
Fred Tingaud
Committed by
Dominic Hamon
Oct 16, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correct typo in sample code for range-based for loop. (#458)
parent
cacd3218
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
README.md
README.md
+2
-1
No files found.
README.md
View file @
2fc2ea0e
...
...
@@ -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_Fast
e
(
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment