diff --git a/fastboot/util.cpp b/fastboot/util.cpp index e03012a05..5966aead6 100644 --- a/fastboot/util.cpp +++ b/fastboot/util.cpp @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include @@ -43,9 +43,9 @@ using android::base::borrowed_fd; static bool g_verbose = false; double now() { - struct timeval tv; - gettimeofday(&tv, NULL); - return (double)tv.tv_sec + (double)tv.tv_usec / 1000000; + struct timespec ts; + clock_gettime(CLOCK_MONOTONIC, &ts); + return (double)ts.tv_sec + (double)ts.tv_nsec / 1000000000; } void die(const char* fmt, ...) {