run method

  1. @override
Future<Profile> run()
override

The implementation of the benchmark that will produce a Profile.

Implementation

@override
Future<Profile> run() async {
  _runCompleter = Completer<void>();
  final Profile localProfile = profile = Profile(name: name);
  final _RecordingWidgetsBinding binding =
      _RecordingWidgetsBinding.ensureInitialized();
  binding._beginRecording(this, _WidgetBuildRecorderHost(this));

  try {
    await _runCompleter!.future;
    return localProfile;
  } finally {
    _runCompleter = null;
  }
}