ref: 7c4cbbf8d9b0deb06f67cd402a22136014abba45
parent: c3a128842d7ce84074aed1a2c1ff691e12406721
author: Martin Storsjö <martin@martin.st>
date: Wed Aug 5 09:24:14 EDT 2020
checkasm: Use mach_absolute_time() as timer on darwin on ARM The cycle counter instructions aren't accessible on iOS/macOS on ARM. The mach_absolute_time() function has much coarser precision, but is the least bad option available.
--- a/tests/checkasm/checkasm.h
+++ b/tests/checkasm/checkasm.h
@@ -127,6 +127,9 @@
}
#define readtime readtime
#endif
+#elif (ARCH_AARCH64 || ARCH_ARM) && defined(__APPLE__)
+#include <mach/mach_time.h>
+#define readtime() mach_absolute_time()
#elif ARCH_AARCH64
#ifdef _MSC_VER
#include <windows.h>