summaryrefslogtreecommitdiffstats
path: root/libutils
diff options
context:
space:
mode:
authorNarayan Kamath <narayan@google.com>2014-04-15 20:52:51 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-04-15 20:52:51 +0000
commitc9cc643f8b0de8acd365c0caa2a8380c1ca26c1a (patch)
tree79785df9bc41d8565d1ee093e973cf0083a04e54 /libutils
parent0ef87a44f8135b6802ed726ff706aaa5d7a6393d (diff)
parent48030e68e5d2d763ab9c1ca88036837e1e4f3c08 (diff)
downloadcore-c9cc643f8b0de8acd365c0caa2a8380c1ca26c1a.tar.gz
core-c9cc643f8b0de8acd365c0caa2a8380c1ca26c1a.tar.bz2
core-c9cc643f8b0de8acd365c0caa2a8380c1ca26c1a.zip
am 48030e68: am e7ddcad8: am 0f4575db: Merge "HAVE_POSIX_CLOCKS doesn\'t imply CLOCK_BOOTTIME."
* commit '48030e68e5d2d763ab9c1ca88036837e1e4f3c08': HAVE_POSIX_CLOCKS doesn't imply CLOCK_BOOTTIME.
Diffstat (limited to 'libutils')
-rw-r--r--libutils/Timers.cpp6
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);