diff options
Diffstat (limited to 'wsutil')
-rw-r--r-- | wsutil/glib-compat.c | 14 | ||||
-rw-r--r-- | wsutil/glib-compat.h | 1 |
2 files changed, 15 insertions, 0 deletions
diff --git a/wsutil/glib-compat.c b/wsutil/glib-compat.c index 5d3cec8374..8acc520b49 100644 --- a/wsutil/glib-compat.c +++ b/wsutil/glib-compat.c @@ -62,6 +62,20 @@ g_list_free_full(GList *list, g_list_free(list); } +/** +* g_get_monotonic_time: +* +* Queries the system monotonic time. Returns value in microseconds. +* +* Since: 2.28 +*/ +gint64 g_get_monotonic_time (void) +{ + GTimeVal result; + g_get_current_time(&result); + return result.tv_sec*1000000 + result.tv_usec; +} + #endif /* * Editor modelines - http://www.wireshark.org/tools/modelines.html diff --git a/wsutil/glib-compat.h b/wsutil/glib-compat.h index 378a020b0d..adaa630f8e 100644 --- a/wsutil/glib-compat.h +++ b/wsutil/glib-compat.h @@ -27,6 +27,7 @@ #if !GLIB_CHECK_VERSION(2, 28, 0) WS_DLL_PUBLIC void g_slist_free_full(GSList *list, GDestroyNotify free_func); WS_DLL_PUBLIC void g_list_free_full(GList *list, GDestroyNotify free_func); +WS_DLL_PUBLIC gint64 g_get_monotonic_time (void); #endif #endif /* GLIB_COMPAT_H */ |