mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-15 17:30:27 +08:00
perf.优化任务 sleep 的实现
This commit is contained in:
@@ -56,8 +56,8 @@ bool AbstractTask::sleep(unsigned millisecond)
|
||||
|
||||
while (!need_exit() && duration < millisecond) {
|
||||
duration = std::chrono::duration_cast<std::chrono::milliseconds>(
|
||||
std::chrono::steady_clock::now() - start)
|
||||
.count();
|
||||
std::chrono::steady_clock::now() - start).count();
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(100));
|
||||
std::this_thread::yield();
|
||||
}
|
||||
m_callback(AsstMsg::EndOfSleep, callback_json, m_callback_arg);
|
||||
|
||||
Reference in New Issue
Block a user