All right thank you for sharing your results. Now I know that the analogRead function is the slowest of all. Now I should test it but in the "fast mode"
Grumpy_Mike:
The case you are missing is when you do no operation, this base line overhead must be subtracted from all results for a meaningful measure.Also due to the low resolution of the micros timer you should do more than one operation and divide the result by N where N is the number of times you did the operation.
Ok then. So...
- Do you suggest me to test even the micros function itself?
- In order to test an operation mutiple times, which one of these statements will be faster: for or while?
- How can I test a substraction operation? I guess I can create a variable apart from the already existing ones. What kind of substraction shall I test? From coded values or from variables' values?