#ifdef WIN32 #define OS_WINDOWS WIN32 #include <windows.h> #endif #ifdef LINUX #include <unistd.h> #include <sys/time.h> #include <netinet/in.h> #endif #define ULONAG unsigned long ULONGA getTickCount(void) { ULONGA currentTime; #ifdef WIN32 currentTime = GetTickCount(); #endif #ifdef LINUX struct timeval current; gettimeofday(¤t, NULL); currentTime = current.tv_sec * 1000 + current.tv_usec/1000; #endif return currentTime; }