Class: matlab.perftest.TestCase
Package: matlab.perftest
Designate end of measurement boundary
stopMeasuring(
designates the
end of a measurement boundary. Invoke this method and the
testcase
)startMeasuring
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 startMeasuring
method must call the
stopMeasuring
method in the scope of the same test
method.
A call to the startMeasuring
method must have a subsequent call
to stopMeasuring
method in the scope of the same test method.
Similarly, a call to the stopMeasuring
method must have a preceding
call to startMeasuring
.
You cannot call the startMeasuring
and
stopMeasuring
methods inside a while
loop
that has the keepMeasuring
method in the condition. Similarly, you
cannot have a while
loop that has the
keepMeasuring
condition between calls to
startMeasuring
and stopMeasuring
.
If a test method has multiple calls to startMeasuring
and
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.
stopMeasuring(
designates the end 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 stopMeasuring
with a label must have a preceding call to startMeasuring
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
.