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