Skip to content

Commit

Permalink
mac support
Browse files Browse the repository at this point in the history
  • Loading branch information
edwinans committed Dec 23, 2024
1 parent ea2267a commit 08ed060
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ CAMLprim int64_t caml_highres_clock_native(value unit)
int64_t v;
v = __rdtsc();
return v;
#elif defined(__aarch64__)
uint64_t v;
__asm__ __volatile__ ("mrs %0, cntvct_el0" : "=r"(v));
return v;
#elif defined(__GNUC__)
uint32_t hi = 0, lo = 0;
__asm__ __volatile__ ("rdtsc" : "=a"(lo), "=d"(hi));
Expand Down

0 comments on commit 08ed060

Please sign in to comment.