Society of Robots - Robot Forum

Software => Software => Topic started by: flokos on May 30, 2010, 12:31:42 PM

Title: For how long a funcion is running in arduino duemilanove.
Post by: flokos on May 30, 2010, 12:31:42 PM
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?
Title: Re: For how long a funcion is running in arduino duemilanove.
Post by: Razor Concepts on May 30, 2010, 12:42:45 PM
The command millis()

http://www.arduino.cc/en/Reference/Millis (http://www.arduino.cc/en/Reference/Millis)
Title: Re: For how long a funcion is running in arduino duemilanove.
Post by: flokos on May 30, 2010, 12:45:15 PM
Quote
Description

Returns the number of milliseconds since the Arduino board began running the current program. This number will overflow (go back to zero), after approximately 50 days.

This one shows the time the arduino is running and not the time a specific function is running...
Title: Re: For how long a funcion is running in arduino duemilanove.
Post by: cyberfish on May 30, 2010, 12:47:00 PM
Call it when you enter and exit the function. Take the difference.
Title: Re: For how long a funcion is running in arduino duemilanove.
Post by: flokos on May 30, 2010, 12:58:20 PM
Thanks for the reply....