summaryrefslogtreecommitdiffstats
path: root/linux
diff options
context:
space:
mode:
authorarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-10-19 02:16:21 +0000
committerarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-10-19 02:16:21 +0000
commit2a680c8d21deddedeafac3cdb380a8c2ff7fcd22 (patch)
tree868a9929aea6a7b4b5cbc35008f26850073a7157 /linux
parenta16cebf64ae28c7844d67fa91627c863d36a8881 (diff)
downloadmpv-2a680c8d21deddedeafac3cdb380a8c2ff7fcd22.tar.bz2
mpv-2a680c8d21deddedeafac3cdb380a8c2ff7fcd22.tar.xz
sleep stuff moved to linux/timer
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@2274 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'linux')
-rw-r--r--linux/timer-lx.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/linux/timer-lx.c b/linux/timer-lx.c
index fd251e9251..8caf93ec62 100644
--- a/linux/timer-lx.c
+++ b/linux/timer-lx.c
@@ -3,6 +3,19 @@
#include <unistd.h>
#include <sys/time.h>
+int usec_sleep(int usec_delay)
+{
+#if 1
+ struct timespec ts;
+ ts.tv_sec = usec_delay / 1000000;
+ ts.tv_nsec = (usec_delay % 1000000) * 1000;
+ return nanosleep(&ts, NULL);
+#else
+ return usleep(usec_delay);
+#endif
+}
+
+
// Returns current time in microseconds
unsigned int GetTimer(){
struct timeval tv;