Merge "base: chrono_utils: supported in linux"
This commit is contained in:
commit
142303b9d9
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue