This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Compiler/CC1350: How to measure code execution times.

Part Number: CC1350


Tool/software: TI C/C++ Compiler

Hello,

I am trying to find the best was to measure execution time of a specific section of code I am writing.  I am using ccs compiler and tirtos.  Does anyone have ideas what I can do to measure the execution time of the following pseudo code?

get start time

Function()

{

...

}

get end time.

I need the time in ms.   I an not that familiar with tirtos yet.

Thanks,

Rob

  • You can use a benchmark event and have it shown in System Analyzer is CCS. Enable logging by using LoggingSetup in the .cfg file. By default 3 LoggerStopmode instances are created. Then add the following into your code

    #include <xdc/runtime/Log.h>
    #include <ti/uia/events/UIABenchmark.h>

    foo()
    Log_write1(UIABenchmark_start, (IArg)"My benchmark event");
    functionToMeasure()
    Log_write1(UIABenchmark_stop, (IArg)"My benchmark event");

    When you stop the target and System Analyzer, you can select the duration view. You can see the min, max and average. Note: LoggerStopmode uses RAM buffers to store the log events. The bigger the buffers, the more data you can accumulate.

    Todd
  • Thank you so much Todd!