2003-02-02 Piers Haken <piersh@friskit.com>
[mono.git] / mono / io-layer / timefuncs.c
1 /*
2  * timefuncs.c:  performance timer and other time functions
3  *
4  * Author:
5  *      Dick Porter (dick@ximian.com)
6  *
7  * (C) 2002 Ximian, Inc.
8  */
9
10 #include <config.h>
11 #include <glib.h>
12 #include <sys/time.h>
13 #include <stdlib.h>
14
15 #include <mono/io-layer/wapi.h>
16 #include <mono/io-layer/timefuncs-private.h>
17
18 void _wapi_time_t_to_filetime (time_t timeval, WapiFileTime *filetime)
19 {
20         guint64 ticks;
21         
22         ticks = ((guint64)timeval * 10000000) + 116444736000000000UL;
23         filetime->dwLowDateTime = ticks & 0xFFFFFFFF;
24         filetime->dwHighDateTime = ticks >> 32;
25 }
26
27 void _wapi_timeval_to_filetime (struct timeval *tv, WapiFileTime *filetime)
28 {
29         guint64 ticks;
30         
31         ticks = ((guint64)tv->tv_sec * 10000000) +
32                 ((guint64)tv->tv_usec * 10) + 116444736000000000UL;
33         filetime->dwLowDateTime = ticks & 0xFFFFFFFF;
34         filetime->dwHighDateTime = ticks >> 32;
35 }
36
37 gboolean QueryPerformanceCounter(WapiLargeInteger *count G_GNUC_UNUSED)
38 {
39         return(FALSE);
40 }
41
42 gboolean QueryPerformanceFrequency(WapiLargeInteger *freq G_GNUC_UNUSED)
43 {
44         return(FALSE);
45 }
46