We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2048ac6 commit e6fea81Copy full SHA for e6fea81
benchmark/lib/benchmark.dart
@@ -1,3 +1,4 @@
1
+import 'dart:async';
2
import 'dart:io';
3
4
import 'package:meta/meta.dart';
@@ -56,12 +57,17 @@ class Benchmark {
56
57
58
/// Calls [runIteration] [iterations] of times.
59
Future<void> run() async {
- for (var i = 0; i < iterations; i++) runIteration(i);
60
+ for (var i = 0; i < iterations; i++) {
61
+ final result = runIteration(i);
62
+ if (result is Future) {
63
+ await result;
64
+ }
65
66
return Future.value();
67
}
68
69
/// A single test iteration, given [iteration] index starting from 0.
- void runIteration(int iteration) {
70
+ FutureOr<void> runIteration(int iteration) {
71
throw UnimplementedError('Please override runIteration() or run()');
72
73
0 commit comments