Main Content

Generate Execution Time Profile

Before running a software-in-the-loop (SIL) or processor-in-the-loop (PIL) execution, enable execution time profiling:

  1. To open the MATLAB® Coder™ app, on the MATLAB Toolstrip Apps tab, under Code Generation, click the app icon.

  2. To open your project, click and then click Open existing project. Select the project.

  3. On the Generate Code page, click Verify Code.

  4. Select the Enable entry point execution profiling for SIL/PIL check box.

  5. If you also want to generate execution time profiles for functions that are called within entry-point functions, select the Enable function execution profiling check box.

    Note

    Function profiling does not support the OpenMP library. Before you generate code, on the Generate Code page, click the arrow next to Generate. Then, click More Settings. Under Advanced, set Enable OpenMP library if possible to No.

    On a Mac operating system, SIL and PIL execution does not support execution-time profiling for functions that are called within entry-point functions.

Or, from the Command Window, specify properties of your coder.EmbeddedCodeConfig object. For example:

% Enable entry point execution profiling
config.CodeExecutionProfiling = true;

% Enable function execution profiling
config.CodeProfilingInstrumentation = true;

% Disable OpenMP
config.EnableOpenMP = false;

Related Examples

More About