How to use timer?
ywwyewenwei opened this issue · comments
ywwyewenwei commented
Qize Huang commented
There is no need to use QTimer in coroutines, just call Coroutine::sleep()
or Coroutine::msleep()
instead:
Coroutine::spawn([] {
while (true) {
qDebug()<< "hello, there!";
Coroutine::sleep(1.0); // or msleep(1000);
}
});
ywwyewenwei commented
Thanks a lot.