【发布时间】:2015-06-21 08:53:52
【问题描述】:
我想停止/休眠执行以模拟长时间的过程,不幸的是我找不到有关它的信息。我已阅读以下主题 (How can I "sleep" a Dart program),但这不是我想要的。
例如,dart:io 包中的 sleep() 函数不适用,因为此包在浏览器中不可用。
例如:
import 'dart:html';
main() {
// I want to "sleep"/hang executing during several seconds
// and only then run the rest of function's body
querySelect('#loading').remove();
...other functions and actions...
}
我知道有Timer类在一段时间后进行回调,但它仍然不妨碍整个程序的执行。
【问题讨论】:
标签: dart dart-async