diff --git a/src/psmoveservice/Server/PSMoveService.cpp b/src/psmoveservice/Server/PSMoveService.cpp index 8cca3c7f..e6f4b2fe 100644 --- a/src/psmoveservice/Server/PSMoveService.cpp +++ b/src/psmoveservice/Server/PSMoveService.cpp @@ -87,14 +87,6 @@ class PSMoveServiceImpl while (m_status->state() != boost::application::status::stoped) { -#if defined(WIN32) - //###Externet Change the minimum resolution for periodic timers on Windows to 1ms. - // On some windows systems the default minimum resolution is ~15ms which can have undesiered effects for tracking. - // This is needed for Windows 10 2004 and prior versions since any app can change the minimum resolution globaly. - timeBeginPeriod(1); -#endif - - if (m_status->state() != boost::application::status::paused) { update(); @@ -136,9 +128,15 @@ class PSMoveServiceImpl } } - std::this_thread::sleep_for(std::chrono::milliseconds(cfg.thread_sleep_ms)); #if defined(WIN32) + //###Externet Change the minimum resolution for periodic timers on Windows to 1ms. + // On some windows systems the default minimum resolution is ~15ms which can have undesiered effects for tracking. + // This is needed for Windows 10 2004 and prior versions since any app can change the minimum resolution globaly. + timeBeginPeriod(1); + std::this_thread::sleep_for(std::chrono::milliseconds(cfg.thread_sleep_ms)); timeEndPeriod(1); +#else + std::this_thread::sleep_for(std::chrono::milliseconds(cfg.thread_sleep_ms)); #endif } }