setUp function

void setUp(
  1. void callback()
)

Registers a function to be run before the benchmarks.

This function will be called before each benchmark is run. If you want to run before each iteration of a benchmark see setUpEach.

If this is called within a group, it applies only to benchmarks in that group. The callback will be run after any set-up callbacks in parent groups or at the top level.

Each callback at the top level or in a given group will be run in the order they were declared.

Implementation

void setUp(void Function() callback) => _g.setUp(callback);