From 2a680c8d21deddedeafac3cdb380a8c2ff7fcd22 Mon Sep 17 00:00:00 2001 From: arpi Date: Fri, 19 Oct 2001 02:16:21 +0000 Subject: [PATCH] sleep stuff moved to linux/timer git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@2274 b3059339-0415-0410-9bf9-f77b7e298cf2 --- linux/timer-lx.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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 #include +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;