@@ -110,38 +110,29 @@ function testCounterAdd(testCase)
110110 mt = opentelemetry .metrics .getMeter(" foo" );
111111 c = createCounter(mt , " bar" );
112112
113- testCase .startMeasuring();
114- % run through a loop since the time for 1 iteration is too short
115- for i = 1 : 10
113+ while (testCase .keepMeasuring )
116114 add(c , 5 );
117115 end
118- testCase .stopMeasuring();
119116 end
120117
121118 function testUpDownCounterAdd(testCase )
122119 % Increment an up-down-counter
123120 mt = opentelemetry .metrics .getMeter(" foo" );
124121 c = createUpDownCounter(mt , " bar" );
125122
126- testCase .startMeasuring();
127- % run through a loop since the time for 1 iteration is too short
128- for i = 1 : 10
123+ while (testCase .keepMeasuring )
129124 add(c , - 5 );
130125 end
131- testCase .stopMeasuring();
132126 end
133127
134128 function testHistogramRecord(testCase )
135129 % record a histogram value
136130 mt = opentelemetry .metrics .getMeter(" foo" );
137131 h = createHistogram(mt , " bar" );
138132
139- testCase .startMeasuring();
140- % run through a loop since the time for 1 iteration is too short
141- for i = 1 : 10
133+ while (testCase .keepMeasuring )
142134 record(h , 111 );
143135 end
144- testCase .stopMeasuring();
145136 end
146137
147138 function testCounterAttributes(testCase )
0 commit comments