Main Content

getTimingInfo

Class: sltest.testmanager.TestFileResult
Namespace: sltest.testmanager

Timing execution information for test file results

Since R2024a

Syntax

timing = getTimingInfo(tfr)
timing = getTimingInfo(tfr,phase)

Description

timing = getTimingInfo(tfr) returns the timing durations for the Setup and Cleanup callbacks and Coverage execution phases in the test file result. If a phase does not exist for the file, timing for that phase is not returned.

timing = getTimingInfo(tfr,phase) returns the duration of the specified execution phase or phases in the test file result. To obtain timing durations for more than one phase, enter a comma-separated list.

Note

Multiple-release tests, real-time tests, and RoadRunner tests do not create TimingInfo objects.

Input Arguments

expand all

Test file result, specified as a sltest.testmanager.TestFileResult object.

Example: getTimingInfo(tfr)

Test execution phase, specified as a property of the sltest.testmanager.TimingInfo class. Timing at the test file level is available only for Setup and Cleanup callbacks and Coverage test execution phases.

Example: getTimingInfo(tfr,"Coverage")

Output Arguments

expand all

Duration of all or the specified test file execution phases, returned as an sltest.testmanager.TimingInfo object. The object contains the timing information for a test file result.

Examples

expand all

Open the mSldvdemoCruiseControl model and its test file. Then, run the test and get the test file results. Get the timing information at the test file level.

You must have Simulink® Coverage™ installed to run this example.

openExample("mSldvdemoCruiseControl")
sltest.testmanager.TestFile("MergeCoverage.mldatx");

result_set = sltest.testmanager.run;

tfr = getTestFileResults(result_set);
timing = getTimingInfo(tfr)
timing = 

  TimingInfo with properties:

    Coverage: 0.1990

Version History

Introduced in R2024a