precisionProfileAsyncResult<T> function
Future<T>
precisionProfileAsyncResult<T>(
- AsyncVoidCallbackR<
T> cb, { - String? tag,
- ProfileReporterCallback? reporter,
Implementation
Future<T> precisionProfileAsyncResult<T>(AsyncVoidCallbackR<T> cb,
{String? tag, ProfileReporterCallback? reporter}) async {
PrecisionStopwatch p = PrecisionStopwatch.start();
T t = await cb();
double ms = p.getMilliseconds();
if (reporter != null) {
reporter(ms);
} else {
verbose("${tag ?? "Runner"} took ${ms.toStringAsFixed(2)}ms");
}
return t;
}