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
e2633b9b
Commit
e2633b9b
authored
Jan 16, 2014
by
Dominic Hamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sysinfo conditional compilation fixes for OSX
parent
076f0df7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
sysinfo.cc
src/sysinfo.cc
+4
-0
No files found.
src/sysinfo.cc
View file @
e2633b9b
...
...
@@ -42,6 +42,7 @@ double cpuinfo_cycles_per_second = 1.0;
int
cpuinfo_num_cpus
=
1
;
// Conservative guess
pthread_mutex_t
cputimens_mutex
;
#if !defined OS_MACOSX
// Helper function estimates cycles/sec by observing cycles elapsed during
// sleep(). Using small sleep time decreases accuracy significantly.
int64_t
EstimateCyclesPerSecond
()
{
...
...
@@ -49,7 +50,9 @@ int64_t EstimateCyclesPerSecond() {
SleepForMilliseconds
(
estimate_time_ms
);
return
cycleclock
::
Now
()
-
start_ticks
;
}
#endif
#if defined OS_LINUX || defined OS_CYGWIN
// Helper function for reading an int from a file. Returns true if successful
// and the memory location pointed to by value is set to the value read.
bool
ReadIntFromFile
(
const
char
*
file
,
int
*
value
)
{
...
...
@@ -69,6 +72,7 @@ bool ReadIntFromFile(const char* file, int* value) {
}
return
ret
;
}
#endif
void
InitializeSystemInfo
()
{
bool
saw_mhz
=
false
;
...
...
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