+/**
+ * timeabs_add - add a relative to an absolute time
+ * @a: the absolute time.
+ * @b: a relative time.
+ *
+ * The times must not overflow, or the results are undefined.
+ *
+ * Example:
+ * // We do one every second.
+ * static struct timeabs next_time(void)
+ * {
+ * return timeabs_add(time_now(), time_from_msec(1000));
+ * }
+ */
+static inline struct timeabs timeabs_add(struct timeabs a, struct timerel b)
+{
+ struct timeabs t;
+
+ t.ts = time_add_(a.ts, b.ts);
+ return t;
+}
+
+/**
+ * timemono_add - add a relative to a monotonic time
+ * @a: the monotonic time.
+ * @b: a relative time.
+ *
+ * The times must not overflow, or the results are undefined.
+ *
+ * Example:
+ * // We do one every second.
+ * static struct timemono next_timem(void)
+ * {
+ * return timemono_add(time_mono(), time_from_msec(1000));
+ * }
+ */
+static inline struct timemono timemono_add(struct timemono a, struct timerel b)
+{
+ struct timemono t;
+
+ t.ts = time_add_(a.ts, b.ts);
+ return t;
+}
+
+/**
+ * timerel_add - add two relative times
+ * @a: one relative time.
+ * @b: another relative time.
+ *
+ * The times must not overflow, or the results are undefined.
+ *
+ * Example:
+ * static struct timerel double_time(struct timerel a)
+ * {
+ * return timerel_add(a, a);
+ * }
+ */
+static inline struct timerel timerel_add(struct timerel a, struct timerel b)
+{
+ struct timerel t;
+
+ t.ts = time_add_(a.ts, b.ts);
+ return t;
+}
+