#include <utils/mono-time.h>
-#define MTICKS_PER_SEC 10000000
+#define MTICKS_PER_SEC (10 * 1000 * 1000)
+
+gint64
+mono_msec_ticks (void)
+{
+ return mono_100ns_ticks () / 10 / 1000;
+}
#ifdef HOST_WIN32
#include <windows.h>
-guint32
-mono_msec_ticks (void)
+#ifndef _MSC_VER
+/* we get "error: implicit declaration of function 'GetTickCount64'" */
+ULONGLONG GetTickCount64(void);
+#endif
+
+gint64
+mono_msec_boottime (void)
{
/* GetTickCount () is reportedly monotonic */
- return GetTickCount ();
+ return GetTickCount64 ();
}
/* Returns the number of 100ns ticks from unspecified time: this should be monotonic */
}
/* Returns the number of milliseconds from boot time: this should be monotonic */
-guint32
-mono_msec_ticks (void)
+gint64
+mono_msec_boottime (void)
{
static gint64 boot_time = 0;
gint64 now;
boot_time = get_boot_time ();
now = mono_100ns_ticks ();
/*printf ("now: %llu (boot: %llu) ticks: %llu\n", (gint64)now, (gint64)boot_time, (gint64)(now - boot_time));*/
+ g_assert (now > boot_time);
return (now - boot_time)/10000;
}