Changeset 376 for trunk/src/core/time.cc
- Timestamp:
- 05/28/15 10:21:10 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/core/time.cc
r319 r376 7 7 #include "nv/core/logging.hh" 8 8 9 #include <ctime> 10 9 11 #if NV_COMPILER == NV_MSVC 10 12 #define WIN32_LEAN_AND_MEAN … … 13 15 #pragma intrinsic(__rdtsc) 14 16 #else 15 #include <unistd.h> 17 #if NV_COMPILER == NV_GNUC && NV_PLATFORM == NV_WINDOWS 18 // mingw doesn't have usleep nor nanosleep... 19 #include <windows.h> 20 #endif 21 // #include <unistd.h> 22 // #include <time.h> 23 // #include <sys/time.h> 24 // #include <sys/types.h> 25 #include <stdio.h> 26 #include <time.h> 16 27 #include <sys/time.h> 17 28 #endif 18 29 19 #include <ctime> 30 20 31 21 32 struct timer_impl … … 58 69 Sleep( ms ); 59 70 #else 60 usleep( ms * 1000 ); 71 #if NV_COMPILER == NV_GNUC && NV_PLATFORM == NV_WINDOWS 72 Sleep( ms ); 73 #else 74 struct timespec ts; 75 ts.tv_sec = 0; 76 ts.tv_nsec = ms * 1000000; 77 nanosleep(&ts, NULL); 78 // usleep( ms * 1000 ); 79 #endif 61 80 #endif 62 81 }
Note: See TracChangeset
for help on using the changeset viewer.