mirror of
https://github.com/google/benchmark.git
synced 2025-03-14 11:20:07 +08:00
parent
bc4639c154
commit
aecbdbff4f
@ -132,7 +132,7 @@ inline BENCHMARK_ALWAYS_INLINE int64_t Now() {
|
||||
|
||||
// Native Client does not provide any API to access cycle counter.
|
||||
// Use clock_gettime(CLOCK_MONOTONIC, ...) instead of gettimeofday
|
||||
// because is provides nanosecond resolution (which is noticable at
|
||||
// because is provides nanosecond resolution (which is noticeable at
|
||||
// least for PNaCl modules running on x86 Mac & Linux).
|
||||
// Initialize to always return 0 if clock_gettime fails.
|
||||
struct timespec ts = {0, 0};
|
||||
|
@ -123,7 +123,7 @@ double ProcessCPUUsage() {
|
||||
// clock_gettime(CLOCK_PROCESS_CPUTIME_ID, ...) returns 0 on Emscripten.
|
||||
// Use Emscripten-specific API. Reported CPU time would be exactly the
|
||||
// same as total time, but this is ok because there aren't long-latency
|
||||
// syncronous system calls in Emscripten.
|
||||
// synchronous system calls in Emscripten.
|
||||
return emscripten_get_now() * 1e-3;
|
||||
#elif defined(CLOCK_PROCESS_CPUTIME_ID) && !defined(BENCHMARK_OS_MACOSX)
|
||||
// FIXME We want to use clock_gettime, but its not available in MacOS 10.11.
|
||||
|
Loading…
Reference in New Issue
Block a user