diff options
author | Narayan Kamath <narayan@google.com> | 2014-04-15 10:56:26 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-04-15 10:56:26 +0000 |
commit | 0f4575dbbd6587023229c87bcd385557a96830ae (patch) | |
tree | b61225c43bb69b3a4cfb8f196fd039eda0169bfa /libutils | |
parent | 4706320eb30812b301675b15a35036190a1c87b6 (diff) | |
parent | ea659643ee1b0c46e473619034cd130440405ac4 (diff) | |
download | core-0f4575dbbd6587023229c87bcd385557a96830ae.tar.gz core-0f4575dbbd6587023229c87bcd385557a96830ae.tar.bz2 core-0f4575dbbd6587023229c87bcd385557a96830ae.zip |
Merge "HAVE_POSIX_CLOCKS doesn't imply CLOCK_BOOTTIME."
Diffstat (limited to 'libutils')
-rw-r--r-- | libutils/Timers.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libutils/Timers.cpp b/libutils/Timers.cpp index 5293cd2a8..a431e9232 100644 --- a/libutils/Timers.cpp +++ b/libutils/Timers.cpp @@ -34,7 +34,7 @@ nsecs_t systemTime(int clock) { -#if defined(HAVE_POSIX_CLOCKS) +#if defined(HAVE_ANDROID_OS) static const clockid_t clocks[] = { CLOCK_REALTIME, CLOCK_MONOTONIC, @@ -47,7 +47,9 @@ nsecs_t systemTime(int clock) clock_gettime(clocks[clock], &t); return nsecs_t(t.tv_sec)*1000000000LL + t.tv_nsec; #else - // we don't support the clocks here. + // Clock support varies widely across hosts. Mac OS doesn't support + // posix clocks, older glibcs don't support CLOCK_BOOTTIME and Windows + // is windows. struct timeval t; t.tv_sec = t.tv_usec = 0; gettimeofday(&t, NULL); |