1 #ifndef __UTILS_MONO_TIME_H__
2 #define __UTILS_MONO_TIME_H__
4 #include <mono/utils/mono-compiler.h>
11 /* Returns the number of milliseconds from boot time: this should be monotonic */
12 guint32 mono_msec_ticks (void);
14 /* Returns the number of 100ns ticks from unspecified time: this should be monotonic */
15 gint64 mono_100ns_ticks (void);
17 /* Returns the number of 100ns ticks since 1/1/1601, UTC timezone */
18 gint64 mono_100ns_datetime (void);
21 gint64 mono_100ns_datetime_from_timeval (struct timeval tv);
24 /* Stopwatch class for internal runtime use */
30 mono_stopwatch_start (MonoStopwatch *w)
32 w->start = mono_100ns_ticks ();
37 mono_stopwatch_stop (MonoStopwatch *w)
39 w->stop = mono_100ns_ticks ();
43 mono_stopwatch_elapsed (MonoStopwatch *w)
45 return (w->stop - w->start) / 10;
49 mono_stopwatch_elapsed_ms (MonoStopwatch *w)
51 return (mono_stopwatch_elapsed (w) + 500) / 1000;
54 #endif /* __UTILS_MONO_TIME_H__ */