summaryrefslogtreecommitdiff
path: root/libavutil/time.h
diff options
context:
space:
mode:
authorMans Rullgard <mans@mansr.com>2012-06-21 17:00:25 +0100
committerMans Rullgard <mans@mansr.com>2012-06-22 17:15:18 +0100
commitd3d3a32c9d389cc0d6a91b389988a225ae01c948 (patch)
tree5115c574ba6da03bca2679cbdc073437de5dfc24 /libavutil/time.h
parentf6b4624fcf9a8f4966b495b9c769ff0796839d57 (diff)
lavu: add av_usleep() function
This function implements a delay using the first available of the following functions: - nanosleep() - usleep() - Sleep() (Windows) The conditional #includes in time.c are simplified by including unistd.h and windows.h whenever they are available rather than having these lines triggered by specific functions. Signed-off-by: Mans Rullgard <mans@mansr.com>
Diffstat (limited to 'libavutil/time.h')
-rw-r--r--libavutil/time.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/libavutil/time.h b/libavutil/time.h
index 2ee7e08caf..b01a97d770 100644
--- a/libavutil/time.h
+++ b/libavutil/time.h
@@ -26,4 +26,14 @@
*/
int64_t av_gettime(void);
+/**
+ * Sleep for a period of time. Although the duration is expressed in
+ * microseconds, the actual delay may be rounded to the precision of the
+ * system timer.
+ *
+ * @param usec Number of microseconds to sleep.
+ * @return zero on success or (negative) error code.
+ */
+int av_usleep(unsigned usec);
+
#endif /* AVUTIL_TIME_H */