Merge "base: chrono_utils: supported in linux"

This commit is contained in:
Mark Salyzyn 2017-10-04 15:55:56 +00:00 committed by Gerrit Code Review
commit 142303b9d9
1 changed files with 2 additions and 2 deletions

View File

@ -22,7 +22,7 @@ namespace android {
namespace base {
boot_clock::time_point boot_clock::now() {
#ifdef __ANDROID__
#ifdef __linux__
timespec ts;
clock_gettime(CLOCK_BOOTTIME, &ts);
return boot_clock::time_point(std::chrono::seconds(ts.tv_sec) +
@ -30,7 +30,7 @@ boot_clock::time_point boot_clock::now() {
#else
// Darwin does not support clock_gettime.
return boot_clock::time_point();
#endif // __ANDROID__
#endif // __linux__
}
std::ostream& operator<<(std::ostream& os, const Timer& t) {