cancel
Showing results for 
Search instead for 
Did you mean: 

SPC58 : how to measure execution time?

hans536
Associate III

I use SPC58nh-disp.

I use "time.h" and clock() function.

but occur error

like

" c:/spc5studio-6.0/eclipse/plugins/com.st.tools.spc5.tools.gnu.gcc.ppcvle.win32_4.9.4.20200908161514/toolchain/bin/../lib/gcc/powerpc-eabivle/4.9.4/../../../../powerpc-eabivle/lib/e200z4\libc.a(lib_a-timesr.o): In function `_times_r':
timesr.c:(.text._times_r+0x2): undefined reference to `times'  "

how to solve??  or Are there other ways to measure execution time????

 

1 ACCEPTED SOLUTION

Accepted Solutions
Erwan YVIN
ST Employee

 

Hello,

i recommend to use this function:

/**
* @brief Returns the current number of ticks.
*
* @return The number of ticks.
*
* @notapi
*/
static uint32_t osalSysTimeGetTicks(void) {

return osalsystime;
}

   Best Regards

                Erwan

 

View solution in original post

1 REPLY 1
Erwan YVIN
ST Employee

 

Hello,

i recommend to use this function:

/**
* @brief Returns the current number of ticks.
*
* @return The number of ticks.
*
* @notapi
*/
static uint32_t osalSysTimeGetTicks(void) {

return osalsystime;
}

   Best Regards

                Erwan