From 88dd1ad1fd3f18bd29fd92887910324781c881ed Mon Sep 17 00:00:00 2001 From: MeT3ger Date: Tue, 16 Jun 2026 00:00:10 +0000 Subject: [PATCH] add ticks for aarch --- tea/util/measure_c.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tea/util/measure_c.h b/tea/util/measure_c.h index 937ace4e..1ce0dcd0 100644 --- a/tea/util/measure_c.h +++ b/tea/util/measure_c.h @@ -1,6 +1,7 @@ #pragma once #include +#include #ifdef __APPLE__ #include "mach/mach_time.h" @@ -17,11 +18,15 @@ inline int64_t MeasureTicks() { uint64_t low, high; __asm__ volatile("rdtsc" : "=a"(low), "=d"(high)); return ((high << 32) | low); +#elif defined(__aarch64__) + struct timespec ts; + clock_gettime(CLOCK_MONOTONIC, &ts); + return (int64_t)ts.tv_sec * 1000000000LL + (int64_t)ts.tv_nsec; #else - static_assert(false); + static_assert(false, "MeasureTicks not implemented for this architecture"); #endif } #ifdef __cplusplus } -#endif +#endif \ No newline at end of file