diff options
author | root <root> | 2009-06-29 07:22:56 +0000 |
---|---|---|
committer | root <root> | 2009-06-29 07:22:56 +0000 |
commit | 3a5da4a6dfdc021c6050f99d653013ed1cd69348 (patch) | |
tree | 47ece55f7f74b5373b0f17c12c4a2b56aa527bd3 /ev_win32.c | |
parent | 7b501a47474faec5ab49aff388f79a17dbdc6e04 (diff) |
*** empty log message ***
Diffstat (limited to 'ev_win32.c')
-rw-r--r-- | ev_win32.c | 23 |
1 files changed, 11 insertions, 12 deletions
@@ -133,22 +133,21 @@ fail: #undef pipe #define pipe(filedes) ev_pipe (filedes) - -static int -ev_gettimeofday (struct timeval *tv, struct timezone *tz) + +#define EV_HAVE_EV_TIME 1 +ev_tstamp +ev_time (void) { - struct _timeb tb; - - _ftime (&tb); + FILETIME ft; + ULARGE_INTEGER ui; - tv->tv_sec = (long)tb.time; - tv->tv_usec = ((long)tb.millitm) * 1000; + GetSystemTimeAsFileTime (&ft); + ui.u.LowPart = ft.dwLowDateTime; + ui.u.HighPart = ft.dwHighDateTime; - return 0; + /* msvc cannot convert ulonglong to double... yes, it is that sucky */ + return (__int64)(ui.QuadPart - 116444736000000000) * 1e-7; } -#undef gettimeofday -#define gettimeofday(tv,tz) ev_gettimeofday (tv, tz) - #endif |