Added/Updated .gitignore files
[mono.git] / mono / io-layer / timefuncs.c
blob16d01f8246b6a57bc54b5a71bdbd4f36fe2f4dcf
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 gboolean QueryPerformanceCounter(WapiLargeInteger *count G_GNUC_UNUSED)
43 return(FALSE);
46 gboolean QueryPerformanceFrequency(WapiLargeInteger *freq G_GNUC_UNUSED)
48 return(FALSE);
51 guint32 GetTickCount (void)
53 return mono_msec_ticks ();