summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/timer.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/include/timer.h b/src/include/timer.h
index 6b7baaf9fd..65ce9b4b79 100644
--- a/src/include/timer.h
+++ b/src/include/timer.h
@@ -166,6 +166,15 @@ static inline int stopwatch_expired(struct stopwatch *sw)
}
/*
+ * Tick and check the stopwatch as long as it has not expired.
+ */
+static inline void stopwatch_wait_until_expired(struct stopwatch *sw)
+{
+ while (!stopwatch_expired(sw))
+ ;
+}
+
+/*
* Return number of microseconds since starting the stopwatch.
*/
static inline long stopwatch_duration_usecs(struct stopwatch *sw)