Main Content


Class: sltest.testmanager.TestCaseResult
Namespace: sltest.testmanager

Timing execution information for test case results

Since R2024a


timing = getTimingInfo(tcr)
timing = getTimingInfo(tcr,phase)


timing = getTimingInfo(tcr) returns the timing durations for the execution phases in the test case result.

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


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

Input Arguments

expand all

Test case result, specified as a sltest.testmanager.TestCaseResult object.

Example: getTimingInfo(tcr)

Test execution phase, specified as a property of the sltest.testmanager.TimingInfo class:

Example: getTimingInfo(tcr,"PreLoad")

Output Arguments

expand all

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


expand all

Open the sltestParameterOverridesExample, clear existing test files and results from the Test Manager, and then open the sltestParameterOverridesTest.mldatx test file. Run the test and get the test file results, test suite results, and test case results. Get the timing information from the test case results.



result_set =;

tfr = getTestFileResults(result_set);
tsr = getTestSuiteResults(tfr);
tcr = getTestCaseResults(tsr);
timing = getTimingInfo(tcr)
timing = 

  TimingInfo with properties:

                     PreLoad: 2.0224
                    PostLoad: 0.0315
                     Cleanup: 0.0407
    SimulationInitialization: 7.0416
         SimulationExecution: 0.0426
       SimulationTermination: 0.6311

To get only the PreLoad and PostLoad durations, enter:

timing1 = getTimingInfo(tcr,"PreLoad","PostLoad")
timing = 

  TimingInfo with properties:

                     PreLoad: 2.0224
                    PostLoad: 0.0315

Version History

Introduced in R2024a