summaryrefslogtreecommitdiff
path: root/src/nm-core-utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/nm-core-utils.h')
-rw-r--r--src/nm-core-utils.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/nm-core-utils.h b/src/nm-core-utils.h
index d974c8af36..33773ab679 100644
--- a/src/nm-core-utils.h
+++ b/src/nm-core-utils.h
@@ -239,6 +239,13 @@ gint64 nm_utils_get_monotonic_timestamp_ms (void);
gint32 nm_utils_get_monotonic_timestamp_s (void);
gint64 nm_utils_monotonic_timestamp_as_boottime (gint64 timestamp, gint64 timestamp_ticks_per_ns);
+static inline gint64
+nm_utils_get_monotonic_timestamp_ns_cached (gint64 *cache_now)
+{
+ return (*cache_now)
+ ?: (*cache_now = nm_utils_get_monotonic_timestamp_ns ());
+}
+
gboolean nm_utils_is_valid_path_component (const char *name);
const char *NM_ASSERT_VALID_PATH_COMPONENT (const char *name);