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
0f5503e9
Commit
0f5503e9
authored
Sep 08, 2015
by
Jean-Louis Leroy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Address Dominic's (stylistic) remarks.
parent
5ec78d7d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
cycleclock.h
src/cycleclock.h
+1
-1
sysinfo.cc
src/sysinfo.cc
+1
-1
walltime.cc
src/walltime.cc
+4
-4
No files found.
src/cycleclock.h
View file @
0f5503e9
...
@@ -41,7 +41,7 @@ extern "C" uint64_t __rdtsc();
...
@@ -41,7 +41,7 @@ extern "C" uint64_t __rdtsc();
#pragma intrinsic(__rdtsc)
#pragma intrinsic(__rdtsc)
#endif
#endif
#if
!defined(OS_WINDOWS)
#if
ndef OS_WINDOWS
#include <sys/time.h>
#include <sys/time.h>
#endif
#endif
...
...
src/sysinfo.cc
View file @
0f5503e9
...
@@ -305,7 +305,7 @@ static double MyCPUUsageRUsage() {
...
@@ -305,7 +305,7 @@ static double MyCPUUsageRUsage() {
user
.
HighPart
=
user_time
.
dwHighDateTime
;
user
.
HighPart
=
user_time
.
dwHighDateTime
;
user
.
LowPart
=
user_time
.
dwLowDateTime
;
user
.
LowPart
=
user_time
.
dwLowDateTime
;
return
(
static_cast
<
double
>
(
kernel
.
QuadPart
)
+
return
(
static_cast
<
double
>
(
kernel
.
QuadPart
)
+
static_cast
<
double
>
(
user
.
QuadPart
))
/
1.0E
7
;
static_cast
<
double
>
(
user
.
QuadPart
))
*
1e-
7
;
#endif // OS_WINDOWS
#endif // OS_WINDOWS
}
}
...
...
src/walltime.cc
View file @
0f5503e9
...
@@ -12,9 +12,9 @@
...
@@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// See the License for the specific language governing permissions and
// limitations under the License.
// limitations under the License.
#include "walltime.h"
#include "benchmark/macros.h"
#include "benchmark/macros.h"
#include "internal_macros.h"
#include "internal_macros.h"
#include "walltime.h"
#if defined(OS_WINDOWS)
#if defined(OS_WINDOWS)
#include <time.h>
#include <time.h>
...
@@ -110,7 +110,7 @@ private:
...
@@ -110,7 +110,7 @@ private:
ularge
.
LowPart
=
file_time
.
dwLowDateTime
;
ularge
.
LowPart
=
file_time
.
dwLowDateTime
;
ularge
.
HighPart
=
file_time
.
dwHighDateTime
;
ularge
.
HighPart
=
file_time
.
dwHighDateTime
;
tv
.
tv_sec
=
(
long
)((
ularge
.
QuadPart
-
epoch
)
/
10000000L
);
tv
.
tv_sec
=
(
long
)((
ularge
.
QuadPart
-
epoch
)
/
(
10L
*
1000
*
1000
)
);
tv
.
tv_usec
=
(
long
)(
system_time
.
wMilliseconds
*
1000
);
tv
.
tv_usec
=
(
long
)(
system_time
.
wMilliseconds
*
1000
);
#else
#else
gettimeofday
(
&
tv
,
nullptr
);
gettimeofday
(
&
tv
,
nullptr
);
...
@@ -167,8 +167,8 @@ WallTimeImp::WallTimeImp()
...
@@ -167,8 +167,8 @@ WallTimeImp::WallTimeImp()
cycles_per_second_
(
0
),
seconds_per_cycle_
(
0.0
),
cycles_per_second_
(
0
),
seconds_per_cycle_
(
0.0
),
last_adjust_time_
(
0
),
drift_adjust_
(
0
),
last_adjust_time_
(
0
),
drift_adjust_
(
0
),
max_interval_cycles_
(
0
)
{
max_interval_cycles_
(
0
)
{
const
double
kMaxErrorInterval
=
100e-6
;
const
double
kMaxErrorInterval
=
100e-6
;
cycles_per_second_
=
static_cast
<
int64_t
>
(
CyclesPerSecond
());
cycles_per_second_
=
static_cast
<
int64_t
>
(
CyclesPerSecond
());
CHECK
(
cycles_per_second_
!=
0
);
CHECK
(
cycles_per_second_
!=
0
);
seconds_per_cycle_
=
1.0
/
cycles_per_second_
;
seconds_per_cycle_
=
1.0
/
cycles_per_second_
;
max_interval_cycles_
=
max_interval_cycles_
=
...
...
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