summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroot <root>2009-06-29 07:22:56 +0000
committerroot <root>2009-06-29 07:22:56 +0000
commit3a5da4a6dfdc021c6050f99d653013ed1cd69348 (patch)
tree47ece55f7f74b5373b0f17c12c4a2b56aa527bd3
parent7b501a47474faec5ab49aff388f79a17dbdc6e04 (diff)
*** empty log message ***
-rw-r--r--ev_win32.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/ev_win32.c b/ev_win32.c
index 61bff50..727c686 100644
--- a/ev_win32.c
+++ b/ev_win32.c
@@ -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