diff options
author | Thomas Haller <thaller@redhat.com> | 2020-01-28 16:28:09 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2020-02-10 19:11:50 +0100 |
commit | 9153e7912f7d101d1b4fb3f73734a15db5535481 (patch) | |
tree | 715ce7877936138ecdf0a500f48ed89fc93f1790 /shared | |
parent | 8b63b229dd2466caba2a9e3cda2e26e79dabd401 (diff) | |
download | NetworkManager-9153e7912f7d101d1b4fb3f73734a15db5535481.tar.gz |
shared: add nm_utils_get_monotonic_timestamp_msec_cached() helper
Diffstat (limited to 'shared')
-rw-r--r-- | shared/nm-glib-aux/nm-time-utils.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/shared/nm-glib-aux/nm-time-utils.h b/shared/nm-glib-aux/nm-time-utils.h index 47715bf50a..190d949127 100644 --- a/shared/nm-glib-aux/nm-time-utils.h +++ b/shared/nm-glib-aux/nm-time-utils.h @@ -37,6 +37,13 @@ nm_utils_get_monotonic_timestamp_nsec_cached (gint64 *cache_now) ?: (*cache_now = nm_utils_get_monotonic_timestamp_nsec ()); } +static inline gint64 +nm_utils_get_monotonic_timestamp_msec_cached (gint64 *cache_now) +{ + return (*cache_now) + ?: (*cache_now = nm_utils_get_monotonic_timestamp_msec ()); +} + gint64 nm_utils_clock_gettime_nsec (clockid_t clockid); gint64 nm_utils_clock_gettime_msec (clockid_t clockid); |