Changeset 1652 for code/branches/gui/src/util/Sleep.h
- Timestamp:
- Jul 28, 2008, 8:45:31 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/gui/src/util/Sleep.h
r1638 r1652 28 28 29 29 /** 30 @file Sleep.h 31 @brief Functions for using sleep() and usleep() under windows 30 @file 31 @brief 32 Functions for using sleep() and usleep() under windows. 32 33 */ 33 34 34 #include "UtilPrereqs.h" 35 #ifndef _Sleep_H__ 36 #define _Sleep_H__ 37 38 #include "OrxonoxPlatform.h" 35 39 36 40 #if ORXONOX_PLATFORM == ORXONOX_PLATFORM_WIN32 37 # ifndef WIN32_LEAN_AND_MEAN 38 # define WIN32_LEAN_AND_MEAN 39 # endif 40 # include <windows.h> 41 42 #ifndef WIN32_LEAN_AND_MEAN 43 # define WIN32_LEAN_AND_MEAN 44 #endif 45 #include <windows.h> 46 41 47 inline void usleep(DWORD dwMicroseconds) 42 48 { 43 49 Sleep(dwMicroseconds / 1000); 44 50 } 51 45 52 inline void msleep(DWORD dwMilliseconds) 46 53 { 47 54 Sleep(dwMilliseconds); 48 55 } 56 49 57 inline void sleep(DWORD dwSeconds) 50 58 { 51 59 Sleep(dwSeconds * 1000); 52 60 } 53 #else 54 # include <unistd.h> 61 62 #else /* Linux/Apple */ 63 64 #include <unistd.h> 65 55 66 inline void msleep(unsigned long msec) 56 67 { 57 68 usleep(msec * 1000); 58 69 } 70 59 71 #endif 72 73 #endif /* _Sleep_H__ */
Note: See TracChangeset
for help on using the changeset viewer.