startMeasuring
Class: matlab.perftest.TestCase
Namespace: matlab.perftest
Designate start of measurement boundary
Description
startMeasuring( designates the
                start of a measurement boundary. Invoke this method and the
                    testcase)stopMeasuring method to restrict measurements to the code
                between the startMeasuring and stopMeasuring
                method calls. Defining this boundary allows you to exclude setup, verification, and
                teardown code from the measurement.
The performance framework permits multiple, nonnested calls to
    the startMeasuring and stopMeasuring methods within each
    method that is tagged with the Test attribute. When creating bounded
    performance tests, keep the following in mind:
- A test method that calls the - startMeasuringmethod must call the- stopMeasuringmethod in the scope of the same test method.
- A call to the - startMeasuringmethod must have a subsequent call to- stopMeasuringmethod in the scope of the same test method. Similarly, a call to the- stopMeasuringmethod must have a preceding call to- startMeasuring.
- You cannot call the - startMeasuringand- stopMeasuringmethods inside a- whileloop that has the- keepMeasuringmethod in the condition. Similarly, you cannot have a- whileloop that has the- keepMeasuringcondition between calls to- startMeasuringand- stopMeasuring.
- If a test method has multiple calls to - startMeasuringand- stopMeasuring, then the performance framework accumulates and sums the measurements.
If the framework encounters unsupported use of startMeasuring
    and stopMeasuring within a test method, it marks the corresponding
        MeasurementResult instance invalid.
startMeasuring( designates the start of a measurement boundary and labels the measurement with testcase,label)label. Specifying a measurement boundary with a label is similar to specifying one without a label. A call to startMeasuring with a label must have a subsequent call to stopMeasuring with the same label in the scope of the same test method. If a test method has multiple boundaries with the same label, then the performance framework accumulates the measurements by label and computes the sum. The performance framework does not support nested measurement boundaries.
The label is appended in angle brackets to the test element name in the Samples and TestActivity properties of the MeasurementResult.
Input Arguments
Examples
Version History
Introduced in R2016a