Future<void> doIt() async {
// here are some operations which are not marked as async
// but still take some time
print ('done');
return;
}
即使内部操作未按如下所示运行,即使内部操作未标记为异步,上述函数也应作为异步执行吗?
await doIt();
print(next output);
输出将会是
next output
done
或
done
next output
或者换句话说,有没有办法 将常规功能执行为异步功能 ?