diff options
author | Chris Wilson <chris+github@qwirx.com> | 2006-09-02 11:12:01 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2006-09-02 11:12:01 +0000 |
commit | 23fead5de5ef2dc968d46e5a7a4d50f9e36b774a (patch) | |
tree | d4ae26971ace26e861a65fcb1cf5b45194b5280e | |
parent | 8894575935e9c3ead5ed27674f85eb4911cb85d8 (diff) |
(refs #3)
Sleep without nanosleep() on Win32
-rw-r--r-- | test/basicserver/testbasicserver.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/test/basicserver/testbasicserver.cpp b/test/basicserver/testbasicserver.cpp index f5185b96..3360cd20 100644 --- a/test/basicserver/testbasicserver.cpp +++ b/test/basicserver/testbasicserver.cpp @@ -31,7 +31,6 @@ #include "MemLeakFindOn.h" - #define SERVER_LISTEN_PORT 2003 // in ms @@ -62,10 +61,14 @@ void basicdaemon::Run() void testservers_pause_before_reply() { - struct timespec t; - t.tv_sec = 0; - t.tv_nsec = COMMS_SERVER_WAIT_BEFORE_REPLYING * 1000 * 1000; // convert to ns - ::nanosleep(&t, NULL); +#ifdef WIN32 + Sleep(COMMS_SERVER_WAIT_BEFORE_REPLYING); +#else + struct timespec t; + t.tv_sec = 0; + t.tv_nsec = COMMS_SERVER_WAIT_BEFORE_REPLYING * 1000 * 1000; // convert to ns + ::nanosleep(&t, NULL); +#endif } #define LARGE_DATA_BLOCK_SIZE 19870 |