Hello,
I need to measure the execution time of a function ( function1() ) in milliseconds and print it. I wrote this code but it just gives me the system ticks. I need milliseconds.
systime_t start,stop, final;
start = chTimeNow();
function ();
stop = chTimeNow();
final = stop - start;
chprintf(chp, Time : %ld.%06ld\r\n",final);
Thank you for your help.
Jessi
STM32F4 Discovery function execution time
Moderator: RoccoMarco
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: STM32F4 Discovery function execution time
Hi,
CH_FREQUENCY should allow you to convert. The version in the repository has new macros for this. 2.6.2 should be released next week with the new macros.
Giovanni
CH_FREQUENCY should allow you to convert. The version in the repository has new macros for this. 2.6.2 should be released next week with the new macros.
Giovanni
Re: STM32F4 Discovery function execution time
Giovanni wrote:Hi,
CH_FREQUENCY should allow you to convert. The version in the repository has new macros for this. 2.6.2 should be released next week with the new macros.
Giovanni
Thanks for your reply,
I think CH_FREQUENCY is a defined constant. How can I use it?
Where is the repository?
Re: STM32F4 Discovery function execution time
Tectu wrote:Jessica wrote:Where is the repository?
http://chibios.org/dokuwiki/doku.php?id ... s:download
~ Tectu
Thank you.