µOS++ IIIe Reference 7.0.0
The third edition of µOS++, a POSIX inspired open source framework, written in C++
Loading...
Searching...
No Matches
os::rtos::thread::statistics Class Reference

Thread statistics. More...

#include <cmsis-plus/rtos/os.h>

Public Member Functions

Constructors & Destructor
 statistics ()=default
 Construct a thread attributes object instance.
 
 ~statistics ()=default
 Destruct the thread attributes object instance.
 
Public Member Functions
rtos::statistics::counter_t context_switches (void)
 Get the number of thread context switches.
 
rtos::statistics::duration_t cpu_cycles (void)
 Get the thread execution time.
 
void clear (void)
 Clear the thread statistic counters.
 

Detailed Description

Thread statistics.

Definition at line 889 of file os-thread.h.

Constructor & Destructor Documentation

◆ statistics()

os::rtos::thread::statistics::statistics ( )
default

Construct a thread attributes object instance.

Parameters
None.

◆ ~statistics()

os::rtos::thread::statistics::~statistics ( )
default

Destruct the thread attributes object instance.

Member Function Documentation

◆ clear()

void os::rtos::thread::statistics::clear ( void  )
inline

Clear the thread statistic counters.

Parameters
None.
Returns
Nothing.

This function sets all statistic counters to zero.

Note
This function is available only when OS_INCLUDE_RTOS_STATISTICS_THREAD_CPU_CYCLES or OS_INCLUDE_RTOS_STATISTICS_THREAD_CONTEXT_SWITCHES is/are defined.
Can be invoked from Interrupt Service Routines.

Definition at line 2317 of file os-thread.h.

◆ context_switches()

statistics::counter_t os::rtos::thread::statistics::context_switches ( void  )
inline

Get the number of thread context switches.

Parameters
None.
Returns
A long integer with the number of times the thread was scheduled for execution.

Each time the scheduler performs a context switch, it increments the thread counter and the scheduler total counter.

This value can be used together with the corresponding scheduler function, to compute percentages.

Note
This function is available only when OS_INCLUDE_RTOS_STATISTICS_THREAD_CONTEXT_SWITCHES is defined.
Can be invoked from Interrupt Service Routines.

Definition at line 2273 of file os-thread.h.

◆ cpu_cycles()

rtos::statistics::duration_t os::rtos::thread::statistics::cpu_cycles ( void  )
inline

Get the thread execution time.

Parameters
None.
Returns
A long integer with accumulated number of CPU cycles.

This value can be used together with the corresponding scheduler function, to compute percentages.

Note
This function is available only when OS_INCLUDE_RTOS_STATISTICS_THREAD_CPU_CYCLES is defined.
Can be invoked from Interrupt Service Routines.

Definition at line 2294 of file os-thread.h.


The documentation for this class was generated from the following file: