record method

Duration record(
  1. String key,
  2. VoidCallback callback, {
  3. required bool reported,
})

Invokes callback and records the duration of its execution under key.

Implementation

Duration record(String key, VoidCallback callback, {required bool reported}) {
  final Duration duration = timeAction(callback);
  addDataPoint(key, duration, reported: reported);
  return duration;
}