A utility method to time a synchronous function. Internally calls function bracketed by calls to startSync and finishSync.
static T timeSync<T>(String name, TimelineSyncFunction<T> function,
{Map arguments, Flow flow}) {
startSync(name, arguments: arguments, flow: flow);
try {
return function();
} finally {
finishSync();
}
}
© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dart.dev/stable/2.5.0/dart-developer/Timeline/timeSync.html