mirror of https://github.com/mpv-player/mpv
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:
parent
a16cebf64a
commit
2a680c8d21
|
@ -3,6 +3,19 @@
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/time.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
|
// Returns current time in microseconds
|
||||||
unsigned int GetTimer(){
|
unsigned int GetTimer(){
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
|
|
Loading…
Reference in New Issue