diff --git a/ortools/sat/cp_model_solver.cc b/ortools/sat/cp_model_solver.cc index 9a80c1c89d..c46655283a 100644 --- a/ortools/sat/cp_model_solver.cc +++ b/ortools/sat/cp_model_solver.cc @@ -23,6 +23,8 @@ #include #include #include +#include +#include #include "ortools/base/commandlineflags.h" #include "ortools/base/logging.h" @@ -68,12 +70,6 @@ #include "ortools/util/sorted_interval_list.h" #include "ortools/util/time_limit.h" -#if defined(_MSC_VER) -#include -#else -#include -#endif - DEFINE_string(cp_model_dump_file, "", "DEBUG ONLY. When this is set to a non-empty file name, " "SolveCpModel() will dump its model to this file. Note that the " @@ -2935,12 +2931,7 @@ CpSolverResponse SolveCpModelWithLNS(const CpModelProto& model_proto, while (!limit->LimitReached()) { response = synchro->f(); if (response.status() != CpSolverStatus::UNKNOWN) break; - // Sleep for 10 ms. - #ifdef __WIN32__ - Sleep(10); - #else - usleep(10000000); - #endif + std::this_thread::sleep_for(std::chrono::milliseconds(50)); } } else { CpModelProto copy = expanded_model;