cancel
Showing results for 
Search instead for 
Did you mean: 

Need to know how much of time is consumed by my thread to run

Cv.1
Associate II
 
2 REPLIES 2

Use a timer or the cycle counter if the MCU has one.

Not clear from the framing of the question which MCU or OS you're talking about.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Erwan SZYMANSKI
ST Employee

hello @Cv.1​,

This question is much a standard C Linux coding question, but the natural solution would be the next one..

If you have the control of the code you run, you should know where is the entry point of your thread after its start, and where it will finish before its destruction.

Just setting up a timer that start at the beginning and stop before the end of the thread should be OK for the information you ask.

Kind regards,

Erwan.

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