From ae737365d7f88c155d4881f68b4104ffb257c41b Mon Sep 17 00:00:00 2001 From: James Chen Date: Wed, 26 Jun 2013 11:34:04 +0800 Subject: [PATCH] issue #2305: Sleep(50) on Win32, usleep(50000) on unix --> std::this_thread::sleep_for(std::chrono::milliseconds(50)); --- extensions/network/WebSocket.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/extensions/network/WebSocket.cpp b/extensions/network/WebSocket.cpp index 73a5a19f09..5cee37b34c 100644 --- a/extensions/network/WebSocket.cpp +++ b/extensions/network/WebSocket.cpp @@ -391,11 +391,8 @@ int WebSocket::onSubThreadLoop() } // Sleep 50 ms -#ifdef WIN32 - Sleep(50); -#else - usleep(50000); -#endif + std::this_thread::sleep_for(std::chrono::milliseconds(50)); + // return 0 to continue the loop. return 0; }