NetBurner 3.3.9
PDF Version
Profiler

This is a very simple profiler program. The way the NBRTOS_TIME functions operate is that there is an additional routine that runs during task switching to record the tick and tickfraction since the task swapped in (runtime since last change).

This feature has overhead and you normally only use it for development. By default, this example enabled profiling through the overload folder functionality. To enable profiling in your own application, you can copy the overload folder in to your application, or following these steps:

  1. Edit \nburn\nbrtos\include\prefef.h and uncomment: #define NBRTOS_TIME(1)
  2. Rebuild the system libraries

    The following functions are now available:

    uint32_t GetCurrentTaskTime( uint32_tconst TotalTicks ); Returns the number of time ticks the current task has run. TotalTicks = the total number of ticks recorded.

    void ShowTaskTimes( void );
    

    Print a list of tasks, times and percentages to stdout (normally uart0)

    void ClearTaskTimes( void );
    

    Resets all task times to 0