[Asterisk-cvs] asterisk/include/asterisk utils.h,1.32,1.33
kpfleming at lists.digium.com
kpfleming at lists.digium.com
Thu Jun 9 10:37:26 CDT 2005
Update of /usr/cvsroot/asterisk/include/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv29142/include/asterisk
Modified Files:
utils.h
Log Message:
move timeval-diff function into utils.h from app_alarmreceiver.c
Index: utils.h
===================================================================
RCS file: /usr/cvsroot/asterisk/include/asterisk/utils.h,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- utils.h 7 Jun 2005 17:06:33 -0000 1.32
+++ utils.h 9 Jun 2005 14:39:34 -0000 1.33
@@ -247,4 +247,17 @@
*/
int ast_build_string(char **buffer, size_t *space, const char *fmt, ...) __attribute__ ((format (printf, 3, 4)));
+/* functions for working with 'struct timeval' instances */
+
+/*!
+ * \brief Computes the difference (in milliseconds) between two \c struct \c timeval instances.
+ * \param start the beginning of the time period
+ * \param end the end of the time period
+ * \return the difference in milliseconds
+ */
+static inline int ast_tvdiff_ms(struct timeval *start, struct timeval *end)
+{
+ return ((end->tv_sec - start->tv_sec) * 1000) + ((end->tv_usec - start->tv_usec) / 1000);
+}
+
#endif /* _ASTERISK_UTILS_H */
More information about the svn-commits
mailing list