Go Down

Topic: For how long a funcion is running in arduino. (Read 1 time) previous topic - next topic


Hi i have an arduino duemilanove and i want to see for how long a function is running in ms .
Can this happen?and how?


Call millis() before the function. Call it again after the function ends. The difference in values is the length of time the function to execute, in milliseconds.
The art of getting good answers lies in asking good questions.


Unless it's a really complicated one. or it involves serial comms, I'd use "micros ()"
"Pete, it's a fool (who) looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.
I speak for myself, not Arduino.

Go Up