using micros() for execution time measurment, can it get "out of order executed"
I am using the micros() function to measure the timing of software blocks:
Is it possible that the compiler changes the order of execution such that the following is compiled? How is the reordering prevented?
If I use a pin that gets toggled at start and stop the compiler sometimes does this reordering. How can I prevent the compiler from rearranging these statements?
I am using the micros() function to measure the timing of software blocks:
Code:
start=micros()
codeblock
stop=micros()
executionTime=stop-start
Code:
start=micros()
stop=micros()
codeblock
executionTime=stop-start