From edcf00043593e125ccc798a70fb6ce2c9318444b Mon Sep 17 00:00:00 2001 From: Baili Feng Date: Tue, 5 Dec 2017 16:59:41 +0800 Subject: Replace wall time Replace gettimeofday with clock_gettime CRs-fixed: 2144315 Change-Id: Ie8472d2aedcd0e63b86cc5ff100ce9bb28fd670c --- core/SystemStatus.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'core/SystemStatus.h') diff --git a/core/SystemStatus.h b/core/SystemStatus.h index 0c9b4b9..4f53c0b 100644 --- a/core/SystemStatus.h +++ b/core/SystemStatus.h @@ -70,10 +70,10 @@ public: static const uint32_t maxItem = 5; SystemStatusItemBase() { - timeval tv; - gettimeofday(&tv, NULL); + struct timespec tv; + clock_gettime(CLOCK_MONOTONIC, &tv); mUtcTime.tv_sec = tv.tv_sec; - mUtcTime.tv_nsec = tv.tv_usec *1000ULL; + mUtcTime.tv_nsec = tv.tv_nsec; mUtcReported = mUtcTime; }; virtual ~SystemStatusItemBase() { }; -- cgit v1.2.3