async_profiler 0.0.1 copy "async_profiler: ^0.0.1" to clipboard
async_profiler: ^0.0.1 copied to clipboard

Profile async function

example/async_profiler_example.dart

import 'package:async_profiler/async_profiler.dart';

void main() async {
  final asyncProfiler = AsyncProfiler();
  var stopWatch = await asyncProfiler.profile<Future<Stopwatch>>(() async {
    final st = Stopwatch()..start();
    await Future.delayed(Duration(seconds: 1));
    await Future.forEach(List.generate(10, (i) => i), (_) async {
      await Future<int>.delayed(Duration(milliseconds: 100));
    });
    return st..stop();
  });
  print(asyncProfiler.profileResults);
  print(stopWatch.elapsedMilliseconds);
}
1
likes
30
pub points
0%
popularity

Publisher

unverified uploader

Profile async function

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

Dependencies

stack_trace

More

Packages that depend on async_profiler