Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
10 years ago.
[RTOS] Measure cpu idle time?
Hi!
I want to test, check and verify some code running in RTOS and need:
1) the time, an algorithm needs for some work. 2) the percentage of time spent to this thread.
1) could be easily done using the Timer class, but only downto microseconds. For nanoseconds I can scale it to microseconds, using loops.
But what about 2) ? It would be enough to measure the idle time. But how to?
Is there a built-in or standard profiling system?
1 Answer
10 years ago.
I think there is no built-in or standard profiling system. If you have a scope, you can add two lines of code to the scheduler to switch on/off a port pin if enter the idle task. With the scope you can monitor this signal down to nanoseconds.