Open 1587 opened 6 years ago
unsigned long long arm_clock(void) { unsigned long long cntvct; asm volatile ("isb; mrs %0, cntvct_el0; isb; " : "=r"(cntvct) :: "memory"); //cntvct = ((__uint128_t)cntvct * NANO_PER_SEC) / this->freq_hz; return cntvct; }
https://stackoverflow.com/questions/32481867/how-is-this-calculation-working