2003-08-17 22:33:37 +00:00
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
#ifdef HAVE_WINDOWS_H
|
|
|
|
#include <windows.h>
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_WINBASE_H
|
|
|
|
# include <winbase.h>
|
|
|
|
#endif
|
|
|
|
|
2003-11-16 22:15:38 +00:00
|
|
|
#ifdef HAVE_SYS_TIME_H
|
2003-08-17 22:33:37 +00:00
|
|
|
#include <sys/time.h>
|
|
|
|
#endif
|
|
|
|
|
2019-11-30 16:19:08 +00:00
|
|
|
/*
|
|
|
|
* broken implementation for WIN32.
|
2003-08-17 22:33:37 +00:00
|
|
|
* FIXME: usec precision
|
|
|
|
*/
|
|
|
|
int gettimeofday(struct timeval *tv, struct timezone *tz)
|
|
|
|
{
|
2019-11-30 16:19:08 +00:00
|
|
|
if (tv)
|
|
|
|
{
|
|
|
|
time_t tm;
|
|
|
|
|
|
|
|
time(&tm);
|
|
|
|
tv->tv_sec = tm;
|
|
|
|
tv->tv_usec = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
2003-08-17 22:33:37 +00:00
|
|
|
}
|
|
|
|
|