time: Add some common defines and conversions
diff --git a/ell/time.h b/ell/time.h
index bc1181e..c9f9510 100644
--- a/ell/time.h
+++ b/ell/time.h
@@ -30,6 +30,13 @@
 #include <stdint.h>
 #include <stdbool.h>
 
+#define L_USEC_PER_SEC 1000000ULL
+#define L_MSEC_PER_SEC 1000ULL
+#define L_USEC_PER_MSEC 1000ULL
+#define L_NSEC_PER_SEC  1000000000ULL
+#define L_NSEC_PER_MSEC 1000000ULL
+#define L_NSEC_PER_USEC 1000ULL
+
 uint64_t l_time_now(void);
 
 static inline bool l_time_after(uint64_t a, uint64_t b)
@@ -56,6 +63,16 @@
 	return (a < b) ? b - a : a - b;
 }
 
+static inline uint64_t l_time_to_secs(uint64_t time)
+{
+	return time / L_USEC_PER_SEC;
+}
+
+static inline uint64_t l_time_to_msecs(uint64_t time)
+{
+	return time / L_USEC_PER_MSEC;
+}
+
 #ifdef __cplusplus
 }
 #endif