X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/085c36723242f7bd1e0fd9bf49b950da6cb96039..0c097ef3435d2a45c1ee4ac80f8bd3f254fb8df5:/projects/stargazer/traffcounter_impl.cpp diff --git a/projects/stargazer/traffcounter_impl.cpp b/projects/stargazer/traffcounter_impl.cpp index a4227497..6a573428 100644 --- a/projects/stargazer/traffcounter_impl.cpp +++ b/projects/stargazer/traffcounter_impl.cpp @@ -128,9 +128,8 @@ assert(h && "USERS::OpenSearch is always correct"); m_onIPConns.clear(); //5 seconds to thread stops itself -struct timespec ts = {0, 200000000}; for (int i = 0; i < 25 && !stopped; i++) - nanosleep(&ts, NULL); + std::this_thread::sleep_for(std::chrono::milliseconds(200)); if (!stopped) { @@ -155,10 +154,9 @@ stopped = false; int c = 0; time_t touchTime = stgTime - MONITOR_TIME_DELAY_SEC; -struct timespec ts = {0, 500000000}; while (!token.stop_requested()) { - nanosleep(&ts, 0); + std::this_thread::sleep_for(std::chrono::milliseconds(500)); if (token.stop_requested()) { FlushAndRemove();