summaryrefslogtreecommitdiff
path: root/tests/system_properties_test2.cpp
diff options
context:
space:
mode:
authorSteven Laver <lavers@google.com>2019-11-09 19:04:59 -0800
committerSteven Laver <lavers@google.com>2019-11-09 19:04:59 -0800
commit19c0c9cd4892927004dac3252b67aac89e462c5c (patch)
tree7e1f345b44a6e9442c89789a1632bce8f35e57df /tests/system_properties_test2.cpp
parent38a2028b52982e46a8dba510b9a9291487ee764e (diff)
parentc640ebfa3afc4c4aadeb38d287028d0d3b2b1308 (diff)
Merge RP1A.191031.003
Change-Id: I88a5da486e0ed587840daf17126c6dcf18bfa204
Diffstat (limited to 'tests/system_properties_test2.cpp')
-rw-r--r--tests/system_properties_test2.cpp10
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