STM32F4 Discovery function execution time

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
Jessica
Posts: 8
Joined: Fri Dec 13, 2013 3:17 pm

STM32F4 Discovery function execution time

Post by Jessica »

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
User avatar
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

Post by Giovanni »

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
Jessica
Posts: 8
Joined: Fri Dec 13, 2013 3:17 pm

Re: STM32F4 Discovery function execution time

Post by Jessica »

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?
User avatar
Tectu
Posts: 1225
Joined: Thu May 10, 2012 9:50 am

Re: STM32F4 Discovery function execution time

Post by Tectu »

Jessica wrote:Where is the repository?

http://chibios.org/dokuwiki/doku.php?id ... s:download


~ Tectu
Jessica
Posts: 8
Joined: Fri Dec 13, 2013 3:17 pm

Re: STM32F4 Discovery function execution time

Post by Jessica »

Tectu wrote:
Jessica wrote:Where is the repository?

http://chibios.org/dokuwiki/doku.php?id ... s:download


~ Tectu


Thank you.
Post Reply