Skip to main content
hans536
Associate III
August 3, 2023
Solved

SPC58 : how to measure execution time?

  • August 3, 2023
  • 1 reply
  • 1298 views

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????

 

This topic has been closed for replies.
Best answer by Erwan YVIN

 

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

 

1 reply

Erwan YVIN
Erwan YVINBest answer
ST Employee
August 28, 2023

 

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