[runtime] Fix "make distcheck"
[mono-project.git] / mono / io-layer / timefuncs.c
blob8a79f3b4d577f3b171d082c396e3d9181e6551cc
1 /*
2 * timefuncs.c: performance timer and other time functions
4 * Author:
5 * Dick Porter (dick@ximian.com)
7 * (C) 2002 Ximian, Inc.
8 */
10 #include <config.h>
11 #include <glib.h>
12 #include <sys/time.h>
13 #include <stdlib.h>
14 #include <stdio.h>
16 #include <mono/io-layer/wapi.h>
17 #include <mono/io-layer/timefuncs-private.h>
18 #include "mono/utils/mono-time.h"
20 #undef DEBUG
22 void _wapi_time_t_to_filetime (time_t timeval, WapiFileTime *filetime)
24 guint64 ticks;
26 ticks = ((guint64)timeval * 10000000) + 116444736000000000ULL;
27 filetime->dwLowDateTime = ticks & 0xFFFFFFFF;
28 filetime->dwHighDateTime = ticks >> 32;
31 void _wapi_timeval_to_filetime (struct timeval *tv, WapiFileTime *filetime)
33 guint64 ticks;
35 ticks = ((guint64)tv->tv_sec * 10000000) +
36 ((guint64)tv->tv_usec * 10) + 116444736000000000ULL;
37 filetime->dwLowDateTime = ticks & 0xFFFFFFFF;
38 filetime->dwHighDateTime = ticks >> 32;
41 void _wapi_guint64_to_filetime (guint64 ticks, WapiFileTime *filetime)
43 filetime->dwLowDateTime = ticks & 0xFFFFFFFF;
44 filetime->dwHighDateTime = ticks >> 32;
47 gboolean QueryPerformanceCounter(WapiLargeInteger *count G_GNUC_UNUSED)
49 return(FALSE);
52 gboolean QueryPerformanceFrequency(WapiLargeInteger *freq G_GNUC_UNUSED)
54 return(FALSE);
57 guint32 GetTickCount (void)
59 return mono_msec_ticks ();