diff --git a/native/tests/unit-test/src/scheduler_test.cpp b/native/tests/unit-test/src/scheduler_test.cpp index ca85307fd5a..a0890b36403 100644 --- a/native/tests/unit-test/src/scheduler_test.cpp +++ b/native/tests/unit-test/src/scheduler_test.cpp @@ -22,6 +22,8 @@ THE SOFTWARE. ****************************************************************************/ #include +#include +#include #include "base/Scheduler.h" #include "utils.h" @@ -50,7 +52,7 @@ TEST(schedulerTest, performInCocosThreadOrder) { orderResult.emplace_back(12); }); - usleep(100 * 1000); + std::this_thread::sleep_for(std::chrono::milliseconds(100)); } }; scheduler->performFunctionInCocosThread(task);