timeSync 静态方法
- String name,
- TimelineSyncFunction<
T> function, { - Map? arguments,
- Flow? flow,
一个用于计时同步 function
的实用方法。内部调用 startSync
和 finishSync
来括号化 function
。
实现
static T timeSync<T>(String name, TimelineSyncFunction<T> function,
{Map? arguments, Flow? flow}) {
startSync(name, arguments: arguments, flow: flow);
try {
return function();
} finally {
finishSync();
}
}