diff options
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 |