diff --git a/src/google/protobuf/map.h b/src/google/protobuf/map.h index 4ea42241dd96..e28c1c6ea2b2 100644 --- a/src/google/protobuf/map.h +++ b/src/google/protobuf/map.h @@ -25,7 +25,7 @@ #include #if !defined(GOOGLE_PROTOBUF_NO_RDTSC) && defined(__APPLE__) -#include +#include #endif #include "google/protobuf/stubs/common.h" @@ -676,7 +676,7 @@ class PROTOBUF_EXPORT UntypedMapBase { #if defined(__APPLE__) // Use a commpage-based fast time function on Apple environments (MacOS, // iOS, tvOS, watchOS, etc). - s = mach_absolute_time(); + s = clock_gettime_nsec_np(CLOCK_UPTIME_RAW); #elif defined(__x86_64__) && defined(__GNUC__) uint32_t hi, lo; asm volatile("rdtsc" : "=a"(lo), "=d"(hi));