summaryrefslogtreecommitdiff
path: root/include/asterisk/time.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asterisk/time.h')
-rw-r--r--include/asterisk/time.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/asterisk/time.h b/include/asterisk/time.h
index 4fa08723b..dd68db704 100644
--- a/include/asterisk/time.h
+++ b/include/asterisk/time.h
@@ -152,6 +152,20 @@ struct timeval ast_tvadd(struct timeval a, struct timeval b);
struct timeval ast_tvsub(struct timeval a, struct timeval b);
/*!
+ * \brief Calculate remaining milliseconds given a starting timestamp
+ * and upper bound
+ *
+ * If the upper bound is negative, then this indicates that there is no
+ * upper bound on the amount of time to wait. This will result in a
+ * negative return.
+ *
+ * \param start When timing started being calculated
+ * \param max_ms The maximum number of milliseconds to wait from start. May be negative.
+ * \return The number of milliseconds left to wait for. May be negative.
+ */
+int ast_remaining_ms(struct timeval start, int max_ms);
+
+/*!
* \brief Returns a timeval from sec, usec
*/
AST_INLINE_API(