Commit 6cadcf7f by Alt Committed by Eric

Fix working on mac clock_gettime (#292)

* fix working on mac clock_gettime * Comment fixme
parent 62c68ba4
......@@ -101,7 +101,8 @@ BENCHMARK_NORETURN static void DiagnoseAndExit(const char* msg) {
double ProcessCPUUsage() {
#if defined(CLOCK_PROCESS_CPUTIME_ID)
// FIXME We want to use clock_gettime, but its not available in MacOS 10.11. See https://github.com/google/benchmark/pull/292
#if defined(CLOCK_PROCESS_CPUTIME_ID) && !defined(BENCHMARK_OS_MACOSX)
struct timespec spec;
if (clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &spec) == 0)
return MakeTime(spec);
......@@ -124,7 +125,8 @@ double ProcessCPUUsage() {
}
double ThreadCPUUsage() {
#if defined(CLOCK_THREAD_CPUTIME_ID)
// FIXME We want to use clock_gettime, but its not available in MacOS 10.11. See https://github.com/google/benchmark/pull/292
#if defined(CLOCK_THREAD_CPUTIME_ID) && !defined(BENCHMARK_OS_MACOSX)
struct timespec ts;
if (clock_gettime(CLOCK_THREAD_CPUTIME_ID, &ts) == 0)
return MakeTime(ts);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment