@@ -650,7 +650,7 @@ class Benchmark {
650
650
__benchmark.runIteration();
651
651
let end = performance.now();
652
652
653
- performanceMeasure (iterationMarkLabel, iterationStartMark );
653
+ performance.measure (iterationMarkLabel, iterationMarkLabel );
654
654
655
655
${ this . postIterationCode }
656
656
@@ -718,19 +718,11 @@ class Benchmark {
718
718
const isInBrowser = ${ isInBrowser } ;
719
719
const isD8 = ${ isD8 } ;
720
720
if (typeof performance.mark === 'undefined') {
721
- performance.mark = function() {};
721
+ performance.mark = function(name ) { return { name } };
722
722
}
723
723
if (typeof performance.measure === 'undefined') {
724
724
performance.measure = function() {};
725
725
}
726
- function performanceMeasure(name, mark) {
727
- // D8 does not implement the official web API.
728
- // Also the performance.mark polyfill returns an undefined mark.
729
- if (isD8 || typeof mark === "undefined")
730
- performance.measure(name, mark);
731
- else
732
- performance.measure(name, mark.name);
733
- }
734
726
` ) ;
735
727
736
728
if ( ! ! this . plan . deterministicRandom ) {
@@ -1181,7 +1173,7 @@ class AsyncBenchmark extends DefaultBenchmark {
1181
1173
await __benchmark.runIteration();
1182
1174
let end = performance.now();
1183
1175
1184
- performanceMeasure (iterationMarkLabel, iterationStartMark );
1176
+ performance.measure (iterationMarkLabel, iterationMarkLabel );
1185
1177
1186
1178
${ this . postIterationCode }
1187
1179
@@ -1280,7 +1272,7 @@ class WSLBenchmark extends Benchmark {
1280
1272
benchmark.buildStdlib();
1281
1273
results.push(performance.now() - start);
1282
1274
1283
- performanceMeasure (markLabel, startMark );
1275
+ performance.measure (markLabel, markLabel );
1284
1276
}
1285
1277
1286
1278
{
@@ -1291,7 +1283,7 @@ class WSLBenchmark extends Benchmark {
1291
1283
benchmark.run();
1292
1284
results.push(performance.now() - start);
1293
1285
1294
- performanceMeasure (markLabel, startMark );
1286
+ performance.measure (markLabel, markLabel );
1295
1287
}
1296
1288
1297
1289
top.currentResolve(results);
0 commit comments