comparison Core/Toolbox.cpp @ 707:203157cb4fde

unit tests of httpclient
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 13 Feb 2014 14:37:35 +0100
parents 01d8611c4a60
children 8cfc6119a5bd ecedd89055db ac8f68cbdbb6
comparison
equal deleted inserted replaced
706:2d829ea1db96 707:203157cb4fde
155 { 155 {
156 finish = true; 156 finish = true;
157 } 157 }
158 #endif 158 #endif
159 159
160 void Toolbox::Sleep(uint32_t seconds)
161 {
162 #if defined(_WIN32)
163 ::Sleep(static_cast<DWORD>(seconds) * static_cast<DWORD>(1000));
164 #elif defined(__linux)
165 usleep(static_cast<uint64_t>(seconds) * static_cast<uint64_t>(1000000));
166 #else
167 #error Support your platform here
168 #endif
169 }
170
171 void Toolbox::USleep(uint64_t microSeconds) 160 void Toolbox::USleep(uint64_t microSeconds)
172 { 161 {
173 #if defined(_WIN32) 162 #if defined(_WIN32)
174 ::Sleep(static_cast<DWORD>(microSeconds / static_cast<uint64_t>(1000))); 163 ::Sleep(static_cast<DWORD>(microSeconds / static_cast<uint64_t>(1000)));
175 #elif defined(__linux) 164 #elif defined(__linux)