Mercurial > mplayer.hg
changeset 2273:e407fc4562f1
sleep stuff moved to linux/timer
author | arpi |
---|---|
date | Fri, 19 Oct 2001 02:16:21 +0000 |
parents | c26a9eff0993 |
children | 9ee34c6950e0 |
files | linux/timer-lx.c |
diffstat | 1 files changed, 13 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/linux/timer-lx.c Fri Oct 19 02:00:45 2001 +0000 +++ b/linux/timer-lx.c Fri Oct 19 02:16:21 2001 +0000 @@ -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;