benchLog function

Future benchLog(
  1. String label,
  2. Function action
)

Log the duration of the func execution.

Implementation

Future benchLog(String label, Function action) async {
  final start = DateTime.now();
  await action();
  final end = DateTime.now();
  final duration = end.difference(start);
  debugPrint('$label: $duration');
}