As the title says, can the call app_timer_cnt_get()
be interrupted by the SoftDevice and return an outdated value?
As the title says, can the call app_timer_cnt_get()
be interrupted by the SoftDevice and return an outdated value?
Anything which takes longer than one instruction can get interrupted by anything with a higher interrupt priority, so not only could app_timer_cnt_get() be interrupted after it reads the count and before it returns it, the code it returns to could get interrupted before it processes the value (which is much more likely as when optimised reading the counter is one single instruction).
You should basically assume that between any two instructions anywhere in your code there could be an indeterminate gap caused by an interrupt, softdevice or other.
I would like to measure how long a certain function takes to run.
I would like to measure how long a certain function takes to run.