Time
Get simulation time for code section
Description
returns
a simulation time vector that corresponds to the execution time measurements
for the code section.SimTime
= NthSectionProfile
.Time
Examples
If you have a model
myModel.slx
that can run a SIL,
PIL, or XCP-based external mode simulation, you
can configure the model to generate a workspace
variable that contains execution time
measurements.
set_param('myModel', 'CodeExecutionProfiling', 'on'); set_param('myModel', 'CodeProfilingInstrumentation', 'detailed'); set_param('myModel', 'CodeProfilingSaveOptions', 'AllData');
sim('myModel')
, the simulation
generates the variable
executionProfile
(default). At
the end of the simulation, get the profile for a
code section. For
example:seventhSectionProfile = executionProfile.Sections(7);
simulationTimeVector = seventhSectionProfile.Time;
In this example, run a SIL model simulation where the model generates a workspace variable that contains execution time measurements.
openExample('ecoder/SILPILVerificationExample', ... supportingFile='SILTopModel.slx') % Disable Simulink Code Coverage and third-party code coverage analysis set_param('SILTopModel',... 'CovEnable', 'off'); covSettings = get_param('SILTopModel', 'CodeCoverageSettings'); covSettings.CoverageTool = 'None'; set_param('SILTopModel', 'CodeCoverageSettings', covSettings); % Configure code execution time profiling set_param('SILTopModel',... 'CodeExecutionProfiling', 'on'); set_param('SILTopModel',... 'CodeProfilingInstrumentation', 'detailed'); set_param('SILTopModel',... 'CodeProfilingSaveOptions', 'AllData'); simOut = sim('SILTopModel');
executionProfile
(default) in
the object simOut
.At the end of the simulation, get the profile for the sixth code section.
sixthSectionProfile = simOut.executionProfile.Sections(6);
Get the vector that represents simulation time for the code section.
simulationTimeVector = sixthSectionProfile.Time;
Input Arguments
Object generated by the coder.profile.ExecutionTime
property Sections
.
Output Arguments
Simulation time, in seconds, for section of code. Returned as a vector.
Version History
Introduced in R2013a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Website auswählen
Wählen Sie eine Website aus, um übersetzte Inhalte (sofern verfügbar) sowie lokale Veranstaltungen und Angebote anzuzeigen. Auf der Grundlage Ihres Standorts empfehlen wir Ihnen die folgende Auswahl: .
Sie können auch eine Website aus der folgenden Liste auswählen:
So erhalten Sie die bestmögliche Leistung auf der Website
Wählen Sie für die bestmögliche Website-Leistung die Website für China (auf Chinesisch oder Englisch). Andere landesspezifische Websites von MathWorks sind für Besuche von Ihrem Standort aus nicht optimiert.
Amerika
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)