현재 시간을 millisecond 단위로 가져오기
Linux
struct timeval time;
int res = gettimeofday(&time, 0);
return 1000 * time.tv_sec + (time.tv_usec / 1000);Windows
FILETIME time;
__int64 msec;
GetSystemTimeAsFileTime(&time);
msec = time.dwHighDateTime;
msec <<= 32;
msec |= time.dwLowDateTime;
msec -= 116444736000000000ULL; // offset to the Linux epoch time
return msec / 10000;
댓글을 달아 주세요