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

SPC58 : how to measure execution time?

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.
Erwan YVIN
Erwan YVINBest answer
ST Technical Moderator
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

 

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question.

1 reply

Erwan YVIN
Erwan YVINBest answer
ST Technical Moderator
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

 

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question.