perfMeasureAsync<T> function
Async variant of perfMeasure.
Implementation
Future<T> perfMeasureAsync<T>(String name, Future<T> Function() fn) async {
if (!_enabled) return fn();
final stopwatch = Stopwatch()..start();
try {
return await fn();
} finally {
stopwatch.stop();
perfLog(name, stopwatch.elapsedMicroseconds);
}
}