diff --git a/paddle/fluid/platform/timer.cc b/paddle/fluid/platform/timer.cc index 0c1dd53037c4044627849df2ee4e15e8ec830448..75d4e5cbf90bd81c73756605eacc6b0c15a63e9d 100644 --- a/paddle/fluid/platform/timer.cc +++ b/paddle/fluid/platform/timer.cc @@ -17,27 +17,6 @@ limitations under the License. */ namespace paddle { namespace platform { -#if defined _WIN32 -static int gettimeofday(struct timeval *tp, void *tzp) { - time_t clock; - struct tm tm; - SYSTEMTIME wtm; - - GetLocalTime(&wtm); - tm.tm_year = wtm.wYear - 1900; - tm.tm_mon = wtm.wMonth - 1; - tm.tm_mday = wtm.wDay; - tm.tm_hour = wtm.wHour; - tm.tm_min = wtm.wMinute; - tm.tm_sec = wtm.wSecond; - tm.tm_isdst = -1; - clock = mktime(&tm); - tp->tv_sec = clock; - tp->tv_usec = wtm.wMilliseconds * 1000; - return (0); -} -#endif - void Timer::Reset() { _start.tv_sec = 0; _start.tv_usec = 0; diff --git a/paddle/fluid/platform/timer.h b/paddle/fluid/platform/timer.h index 1cd5d9936d38d7e80d2a685604f467e055fd9c0b..9bb66eb97ad92e526147a5a4c009880783ac3c94 100644 --- a/paddle/fluid/platform/timer.h +++ b/paddle/fluid/platform/timer.h @@ -14,16 +14,7 @@ limitations under the License. */ #pragma once #include -#if defined __APPLE__ -#include -#else -#include -#if defined _WIN32 -#include -#else -#include -#endif -#endif +#include "paddle/fluid/platform/port.h" namespace paddle { namespace platform {