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
d8c0f274
Commit
d8c0f274
authored
Oct 01, 2018
by
Victor Costan
Committed by
Dominic Hamon
Oct 01, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix possible loss of data warnings in MSVC. (#694)
parent
edc77a36
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
benchmark.h
include/benchmark/benchmark.h
+5
-4
No files found.
include/benchmark/benchmark.h
View file @
d8c0f274
...
@@ -555,13 +555,13 @@ class State {
...
@@ -555,13 +555,13 @@ class State {
BENCHMARK_ALWAYS_INLINE
BENCHMARK_ALWAYS_INLINE
void
SetBytesProcessed
(
int64_t
bytes
)
{
void
SetBytesProcessed
(
int64_t
bytes
)
{
counters
[
"bytes_per_second"
]
=
counters
[
"bytes_per_second"
]
=
Counter
(
bytes
,
Counter
::
kIsRate
,
Counter
::
kIs1024
);
Counter
(
static_cast
<
double
>
(
bytes
)
,
Counter
::
kIsRate
,
Counter
::
kIs1024
);
}
}
BENCHMARK_ALWAYS_INLINE
BENCHMARK_ALWAYS_INLINE
int64_t
bytes_processed
()
const
{
int64_t
bytes_processed
()
const
{
if
(
counters
.
find
(
"bytes_per_second"
)
!=
counters
.
end
())
if
(
counters
.
find
(
"bytes_per_second"
)
!=
counters
.
end
())
return
counters
.
at
(
"bytes_per_second"
);
return
static_cast
<
int64_t
>
(
counters
.
at
(
"bytes_per_second"
)
);
return
0
;
return
0
;
}
}
...
@@ -584,13 +584,14 @@ class State {
...
@@ -584,13 +584,14 @@ class State {
// REQUIRES: a benchmark has exited its benchmarking loop.
// REQUIRES: a benchmark has exited its benchmarking loop.
BENCHMARK_ALWAYS_INLINE
BENCHMARK_ALWAYS_INLINE
void
SetItemsProcessed
(
int64_t
items
)
{
void
SetItemsProcessed
(
int64_t
items
)
{
counters
[
"items_per_second"
]
=
Counter
(
items
,
benchmark
::
Counter
::
kIsRate
);
counters
[
"items_per_second"
]
=
Counter
(
static_cast
<
double
>
(
items
),
benchmark
::
Counter
::
kIsRate
);
}
}
BENCHMARK_ALWAYS_INLINE
BENCHMARK_ALWAYS_INLINE
int64_t
items_processed
()
const
{
int64_t
items_processed
()
const
{
if
(
counters
.
find
(
"items_per_second"
)
!=
counters
.
end
())
if
(
counters
.
find
(
"items_per_second"
)
!=
counters
.
end
())
return
counters
.
at
(
"items_per_second"
);
return
static_cast
<
int64_t
>
(
counters
.
at
(
"items_per_second"
)
);
return
0
;
return
0
;
}
}
...
...
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