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
04a9343f
Commit
04a9343f
authored
Jun 26, 2019
by
Orgad Shaneh
Committed by
Dominic Hamon
Jun 26, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make some functions const (#832)
and ThreadManager ctor explicit. Reported by CppCheck.
parent
090faecb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
benchmark.h
include/benchmark/benchmark.h
+1
-1
thread_manager.h
src/thread_manager.h
+1
-1
thread_timer.h
src/thread_timer.h
+3
-3
No files found.
include/benchmark/benchmark.h
View file @
04a9343f
...
...
@@ -574,7 +574,7 @@ class State {
void
SetComplexityN
(
int64_t
complexity_n
)
{
complexity_n_
=
complexity_n
;
}
BENCHMARK_ALWAYS_INLINE
int64_t
complexity_length_n
()
{
return
complexity_n_
;
}
int64_t
complexity_length_n
()
const
{
return
complexity_n_
;
}
// If this routine is called with items > 0, then an items/s
// label is printed on the benchmark report line for the currently
...
...
src/thread_manager.h
View file @
04a9343f
...
...
@@ -11,7 +11,7 @@ namespace internal {
class
ThreadManager
{
public
:
ThreadManager
(
int
num_threads
)
explicit
ThreadManager
(
int
num_threads
)
:
alive_threads_
(
num_threads
),
start_stop_barrier_
(
num_threads
)
{}
Mutex
&
GetBenchmarkMutex
()
const
RETURN_CAPABILITY
(
benchmark_mutex_
)
{
...
...
src/thread_timer.h
View file @
04a9343f
...
...
@@ -43,19 +43,19 @@ class ThreadTimer {
bool
running
()
const
{
return
running_
;
}
// REQUIRES: timer is not running
double
real_time_used
()
{
double
real_time_used
()
const
{
CHECK
(
!
running_
);
return
real_time_used_
;
}
// REQUIRES: timer is not running
double
cpu_time_used
()
{
double
cpu_time_used
()
const
{
CHECK
(
!
running_
);
return
cpu_time_used_
;
}
// REQUIRES: timer is not running
double
manual_time_used
()
{
double
manual_time_used
()
const
{
CHECK
(
!
running_
);
return
manual_time_used_
;
}
...
...
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