Changeset 2773 for code/trunk/src/util
- Timestamp:
- Mar 11, 2009, 4:06:31 PM (16 years ago)
- Location:
- code/trunk/src/util
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/util/CMakeLists.txt
r2710 r2773 47 47 OutputHandler.cc 48 48 SignalHandler.cc 49 Sleep.cc 49 50 String.cc 50 51 SubString.cc -
code/trunk/src/util/Sleep.h
r2710 r2773 30 30 @file 31 31 @brief 32 Functions for using sleep() and usleep() underwindows.32 Functions for using sleep() and usleep() on windows. 33 33 */ 34 34 … … 38 38 #include "UtilPrereqs.h" 39 39 40 #ifdef ORXONOX_PLATFORM_WINDOWS41 #include <winbase.h>42 43 40 namespace orxonox 44 41 { 45 inline void usleep(DWORD dwMicroseconds) 46 { 47 Sleep(dwMicroseconds / 1000); 48 } 49 50 inline void msleep(DWORD dwMilliseconds) 51 { 52 Sleep(dwMilliseconds); 53 } 54 55 inline void sleep(DWORD dwSeconds) 56 { 57 Sleep(dwSeconds * 1000); 58 } 42 _UtilExport void usleep(unsigned long microseconds); 43 _UtilExport void msleep(unsigned long milliseconds); 44 _UtilExport void sleep (unsigned long seconds); 59 45 } 60 46 61 #else /* Linux/Apple */62 63 #include <unistd.h>64 65 namespace orxonox66 {67 inline void usleep(unsigned long usec)68 {69 ::usleep(usec);70 }71 inline void msleep(unsigned long msec)72 {73 ::usleep(msec * 1000);74 }75 inline void sleep(unsigned long sec)76 {77 ::usleep(sec * 1000000);78 }79 }80 81 #endif82 83 47 #endif /* _Sleep_H__ */
Note: See TracChangeset
for help on using the changeset viewer.