runCreateTest function

int runCreateTest(
  1. SignalCreator fn,
  2. int n,
  3. int scount,
  4. ReactiveFramework framework,
)

Implementation

int runCreateTest(
  SignalCreator fn,
  int n,
  int scount,
  ReactiveFramework framework,
) {
  final stopwatch = Stopwatch();

  framework.withBuild(() {
    var sources = <Signal<int>>[];
    // Warm up
    sources = fn(scount, [], framework);
    fn(n ~/ 100, sources, framework);
    sources = fn(scount, [], framework);
    fn(n ~/ 100, sources, framework);
    sources = fn(scount, [], framework);
    fn(n ~/ 100, sources, framework);
    sources = fn(scount, [], framework);

    stopwatch
      ..reset()
      ..start();
    fn(n, sources, framework);
    stopwatch.stop();
  });

  return stopwatch.elapsedMicroseconds;
}