diff options
author | Josh Gao <jmgao@google.com> | 2017-05-01 20:49:49 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2017-05-01 20:49:50 +0000 |
commit | eaad4e28e885fac2b8203ed529c5e4c558ce989f (patch) | |
tree | 9d2a9ce1a0412c8702ef9d187e959d6df133eb91 /base/chrono_utils.cpp | |
parent | d6f8b5f2d48413d365f0846eb53178145d0d7687 (diff) | |
parent | ae29339ca138648eeaee68f801feb02d85ee2abf (diff) |
Merge "base: make boot_clock work on host linux, hide it on non-linux."
Diffstat (limited to 'base/chrono_utils.cpp')
-rw-r--r-- | base/chrono_utils.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/base/chrono_utils.cpp b/base/chrono_utils.cpp index 5eedf3bceb..d73b551b50 100644 --- a/base/chrono_utils.cpp +++ b/base/chrono_utils.cpp @@ -21,17 +21,14 @@ namespace android { namespace base { +#if defined(__linux__) boot_clock::time_point boot_clock::now() { -#ifdef __ANDROID__ timespec ts; clock_gettime(CLOCK_BOOTTIME, &ts); return boot_clock::time_point(std::chrono::seconds(ts.tv_sec) + std::chrono::nanoseconds(ts.tv_nsec)); -#else - // Darwin does not support clock_gettime. - return boot_clock::time_point(); -#endif // __ANDROID__ } +#endif } // namespace base } // namespace android |