sleep stuff moved to linux/timer

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@2274 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
arpi 2001-10-19 02:16:21 +00:00
parent a16cebf64a
commit 2a680c8d21
1 changed files with 13 additions and 0 deletions

View File

@ -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;