Changes in common/Common.cpp [8f85180:4c202e0] in network-game
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
common/Common.cpp
r8f85180 r4c202e0 1 1 #include "Common.h" 2 3 #include <iostream>4 using namespace std;5 6 #if defined WINDOWS7 #include <Windows.h>8 #elif defined LINUX9 #include <time.h>10 #endif11 2 12 3 void set_nonblock(int sock) … … 22 13 #endif 23 14 } 24 25 unsigned long long getCurrentMillis()26 {27 unsigned long long numMilliseconds;28 29 #if defined WINDOWS30 numMilliseconds = GetTickCount();31 #elif defined LINUX32 timespec curTime;33 clock_gettime(CLOCK_REALTIME, &curTime);34 35 numMilliseconds = curTime.tv_sec*(unsigned long long)1000+curTime.tv_nsec/(unsigned long long)1000000;36 #endif37 38 return numMilliseconds;39 }
Note:
See TracChangeset
for help on using the changeset viewer.