diff options
author | Naresh Munagala <nareshm@codeaurora.org> | 2018-03-30 14:08:29 +0530 |
---|---|---|
committer | Naresh Munagala <nareshm@codeaurora.org> | 2018-03-30 14:09:12 +0530 |
commit | 6530ba80ad184259b0edc3c81d52e48e1259d8af (patch) | |
tree | fba03e6c2ad49f804732bd5f400505c6aacef490 /pla | |
parent | 7f9ce9ddd07927aacf4b02333c66e381ac109bd2 (diff) | |
download | gps-6530ba80ad184259b0edc3c81d52e48e1259d8af.tar.gz |
update uptimeMillis to get boot time
Change-Id: I0f0c8235898e33ed6cee69d7d4c5a1e9b199c835
CRs-Fixed: 2209099
Diffstat (limited to 'pla')
-rw-r--r-- | pla/oe/loc_pla.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/pla/oe/loc_pla.h b/pla/oe/loc_pla.h index 50b19c2..094e3f3 100644 --- a/pla/oe/loc_pla.h +++ b/pla/oe/loc_pla.h @@ -31,7 +31,18 @@ #ifdef __cplusplus #include <utils/SystemClock.h> -#define uptimeMillis android::uptimeMillis +#include <sys/time.h> +#include <time.h> + +inline int64_t uptimeMillis() +{ + struct timespec ts; + int64_t time_ms = 0; + clock_gettime(CLOCK_BOOTTIME, &ts); + time_ms += (ts.tv_sec * 1000000000LL); + time_ms += ts.tv_nsec + 500000LL; + return time_ms / 1000000LL; +} extern "C" { #endif |