inline_benchmarker 1.0.0 copy "inline_benchmarker: ^1.0.0" to clipboard
inline_benchmarker: ^1.0.0 copied to clipboard

Inline Benchmarking Library

example/main.dart

import 'package:inline_benchmarker/inline_benchmarker.dart';

void main() {
  runMyStuff();
  runMyOtherStuff();
}

void runMyStuff() {
  Benchmark runMyStuffBenchmark =
      Benchmarker.generate('runMyStuff', group: 'MAIN');
  Benchmark forLoopBenchmark = Benchmarker.generate('forLoop', autoRun: false);

  for (int i = 0; i < 100; i++) {
    forLoopBenchmark.start();
    runMyOtherStuff();
    forLoopBenchmark.stop();
  }

  runMyStuffBenchmark.stop();

  Benchmarker.report(group: 'MAIN');
  Benchmarker.report();
}

void runMyOtherStuff() {
  Benchmark runMyOtherStuffBenchmark =
      Benchmarker.generate('runMyOtherStuff', indentation: 1, group: 'MAIN');

  runMyOtherStuffBenchmark.stop();
}
0
likes
25
pub points
0%
popularity

Publisher

unverified uploader

Inline Benchmarking Library

Repository (GitHub)
View/report issues

License

BSD-2-Clause (LICENSE)

More

Packages that depend on inline_benchmarker