How to Sleep in Plugin?
Posted: Fri Mar 05, 2021 6:12 pm
Hello!
When I try to Sleep(10000) in my plugin, a plugin with GUI, the plugin crushed.
The Sleep() is to wait a thread, which is doing tasks.
Whether I need to create a new thread to run the Sleep() code?
Thanks!
When I try to Sleep(10000) in my plugin, a plugin with GUI, the plugin crushed.
The Sleep() is to wait a thread, which is doing tasks.
Code: Select all
......
#include <thread>
#include <windows.h>
......
void CCLivoxLOAMDlg::on_StartButton_clicked() {
......
//std::this_thread::sleep_for(std::chrono::seconds(100)); // crush here
Sleep(10000); // here too
......
}
Thanks!