Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
drivers: timer: nrf: Optimize k_cycle_get_32().
The previous implementation of _timer_cycle_get_32() (which is directly mapped to k_cycle_get_32()) taken from 87 to 132 cycles. As result it was too heavy for using it as source of time for logger. This commit makes this function faster by removing redundant access to the RTC register (each access consumed 28 CPU cycles) as well as loop, which made this call non-deterministic. After these changes the k_cycle_get_32() needs only 50-52 cycles in to calculate 32-bit timestamp. Signed-off-by: Piotr Zięcik <[email protected]>
- Loading branch information