Merge pull request #460 from neheb/patch-1
googletest: Switch to nanosleep
This commit is contained in:
commit
6f5699a236
@ -574,7 +574,12 @@ class Thread {
|
||||
|
||||
static inline void SleepForMilliseconds(int t) {
|
||||
#ifndef OS_WINDOWS
|
||||
# if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 199309L
|
||||
const struct timespec req = {0, t * 1000 * 1000};
|
||||
nanosleep(&req, NULL);
|
||||
# else
|
||||
usleep(t * 1000);
|
||||
# endif
|
||||
#else
|
||||
Sleep(t);
|
||||
#endif
|
||||
|
||||
Loading…
Reference in New Issue
Block a user