aboutsummaryrefslogtreecommitdiff
path: root/include/util
diff options
context:
space:
mode:
authorRose Hudson <rose@krx.sh>2023-06-05 16:26:50 +0100
committerSimon Ser <contact@emersion.fr>2023-06-05 19:50:07 +0000
commitbd834fe8d1b9b380391f68c89dcdf35bdcaf64c0 (patch)
tree32f8e3818b3e5dcc6cf96ef322b9d8dd2bbeb162 /include/util
parent37b5f8a89e0705e8d050f0f93ce3e4f12d3d3d1a (diff)
util: add timespec_to_nsec
Diffstat (limited to 'include/util')
-rw-r--r--include/util/time.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/util/time.h b/include/util/time.h
index 890fe55f..09a1f68e 100644
--- a/include/util/time.h
+++ b/include/util/time.h
@@ -14,6 +14,11 @@ int64_t get_current_time_msec(void);
int64_t timespec_to_msec(const struct timespec *a);
/**
+ * Convert a timespec to nanoseconds.
+ */
+int64_t timespec_to_nsec(const struct timespec *a);
+
+/**
* Convert nanoseconds to a timespec.
*/
void timespec_from_nsec(struct timespec *r, int64_t nsec);