diff options
author | Steven Laver <lavers@google.com> | 2019-11-09 19:04:59 -0800 |
---|---|---|
committer | Steven Laver <lavers@google.com> | 2019-11-09 19:04:59 -0800 |
commit | 19c0c9cd4892927004dac3252b67aac89e462c5c (patch) | |
tree | 7e1f345b44a6e9442c89789a1632bce8f35e57df /tests/system_properties_test2.cpp | |
parent | 38a2028b52982e46a8dba510b9a9291487ee764e (diff) | |
parent | c640ebfa3afc4c4aadeb38d287028d0d3b2b1308 (diff) |
Merge RP1A.191031.003
Change-Id: I88a5da486e0ed587840daf17126c6dcf18bfa204
Diffstat (limited to 'tests/system_properties_test2.cpp')
-rw-r--r-- | tests/system_properties_test2.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/system_properties_test2.cpp b/tests/system_properties_test2.cpp index c061faa09..b9936dd48 100644 --- a/tests/system_properties_test2.cpp +++ b/tests/system_properties_test2.cpp @@ -19,16 +19,16 @@ #include <errno.h> #include <sys/wait.h> #include <unistd.h> + +#include <chrono> #include <sstream> #include <string> #if defined(__BIONIC__) #include <sys/system_properties.h> - -static uint64_t NanoTime() { - timespec now; - clock_gettime(CLOCK_MONOTONIC, &now); - return static_cast<uint64_t>(now.tv_sec) * UINT64_C(1000000000) + now.tv_nsec; +int64_t NanoTime() { + auto t = std::chrono::time_point_cast<std::chrono::nanoseconds>(std::chrono::steady_clock::now()); + return t.time_since_epoch().count(); } #endif |