mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-19 00:40:35 +01:00
glib-aux: add nm_utils_clock_gettime_usec() helper
This commit is contained in:
parent
90b6491fa8
commit
2e27f16d26
2 changed files with 11 additions and 0 deletions
|
|
@ -322,6 +322,16 @@ nm_utils_clock_gettime_nsec(clockid_t clockid)
|
|||
return nm_utils_timespec_to_nsec(&tp);
|
||||
}
|
||||
|
||||
gint64
|
||||
nm_utils_clock_gettime_usec(clockid_t clockid)
|
||||
{
|
||||
struct timespec tp;
|
||||
|
||||
if (clock_gettime(clockid, &tp) != 0)
|
||||
return -NM_ERRNO_NATIVE(errno);
|
||||
return nm_utils_timespec_to_usec(&tp);
|
||||
}
|
||||
|
||||
gint64
|
||||
nm_utils_clock_gettime_msec(clockid_t clockid)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -75,6 +75,7 @@ nm_utils_get_monotonic_timestamp_sec_cached(gint32 *cache_now)
|
|||
}
|
||||
|
||||
gint64 nm_utils_clock_gettime_nsec(clockid_t clockid);
|
||||
gint64 nm_utils_clock_gettime_usec(clockid_t clockid);
|
||||
gint64 nm_utils_clock_gettime_msec(clockid_t clockid);
|
||||
|
||||
#endif /* __NM_TIME_UTILS_H__ */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue