Skip to main content
Cv.1
Associate
September 19, 2022
Question

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

  • September 19, 2022
  • 2 replies
  • 851 views

..

This topic has been closed for replies.

2 replies

Tesla DeLorean
Guru
September 19, 2022

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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
Erwan SZYMANSKI
ST Technical Moderator
September 22, 2022

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.