diff options
Diffstat (limited to 'src/inspircd.cpp')
-rw-r--r-- | src/inspircd.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 7dcaeb9b6..45649810b 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -564,21 +564,20 @@ InspIRCd::InspIRCd(int argc, char** argv) void InspIRCd::UpdateTime() { -#ifdef _WIN32 +#if defined HAS_CLOCK_GETTIME + clock_gettime(CLOCK_REALTIME, &TIME); +#elif defined _WIN32 SYSTEMTIME st; GetSystemTime(&st); TIME.tv_sec = time(NULL); TIME.tv_nsec = st.wMilliseconds; #else - #ifdef HAS_CLOCK_GETTIME - clock_gettime(CLOCK_REALTIME, &TIME); - #else - struct timeval tv; - gettimeofday(&tv, NULL); - TIME.tv_sec = tv.tv_sec; - TIME.tv_nsec = tv.tv_usec * 1000; - #endif + struct timeval tv; + gettimeofday(&tv, NULL); + + TIME.tv_sec = tv.tv_sec; + TIME.tv_nsec = tv.tv_usec * 1000; #endif } |