diff --git a/src/google/protobuf/map.h b/src/google/protobuf/map.h index e84ca694dd43..83a3cf20f6e7 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" @@ -691,7 +691,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));