record method
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;
}