timeSync method

dynamic timeSync (String name, TimelineSyncFunction function, { Map arguments, Flow flow })

A utility method to time a synchronous function. Internally calls function bracketed by calls to startSync and finishSync.

Implementation

static dynamic timeSync(String name, TimelineSyncFunction function,
    {Map arguments, Flow flow}) {
  startSync(name, arguments: arguments, flow: flow);
  try {
    return function();
  } finally {
    finishSync();
  }
}