utils/core: add NM_UTILS_NS_PER_MSEC macro
authorThomas Haller <thaller@redhat.com>
Fri, 11 Mar 2016 13:40:58 +0000 (14:40 +0100)
committerThomas Haller <thaller@redhat.com>
Thu, 17 Mar 2016 14:00:48 +0000 (15:00 +0100)
src/nm-core-utils.h

index 8e63923..2fb5273 100644 (file)
@@ -317,6 +317,9 @@ int nm_utils_cmp_connection_by_autoconnect_priority (NMConnection **a, NMConnect
 void nm_utils_log_connection_diff (NMConnection *connection, NMConnection *diff_base, guint32 level, guint64 domain, const char *name, const char *prefix);
 
 #define NM_UTILS_NS_PER_SECOND  ((gint64) 1000000000)
+#define NM_UTILS_NS_PER_MSEC    ((gint64) 1000000)
+#define NM_UTILS_NS_TO_MSEC_CEIL(nsec)      (((nsec) + (NM_UTILS_NS_PER_MSEC - 1)) / NM_UTILS_NS_PER_MSEC)
+
 gint64 nm_utils_get_monotonic_timestamp_ns (void);
 gint64 nm_utils_get_monotonic_timestamp_us (void);
 gint64 nm_utils_get_monotonic_timestamp_ms (void);