perfMeasure<T> function
Wraps fn with timing and logs the result.
Implementation
T perfMeasure<T>(String name, T Function() fn) {
if (!_enabled) return fn();
final stopwatch = Stopwatch()..start();
try {
return fn();
} finally {
stopwatch.stop();
perfLog(name, stopwatch.elapsedMicroseconds);
}
}