mirror of https://github.com/mpv-player/mpv
GetTimerMS added - get timer in millisec
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4386 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
52db9b039a
commit
5786b7ad1e
|
@ -28,6 +28,16 @@ unsigned int GetTimer(){
|
||||||
return (tv.tv_sec*1000000+tv.tv_usec);
|
return (tv.tv_sec*1000000+tv.tv_usec);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Returns current time in milliseconds
|
||||||
|
unsigned int GetTimerMS(){
|
||||||
|
struct timeval tv;
|
||||||
|
struct timezone tz;
|
||||||
|
// float s;
|
||||||
|
gettimeofday(&tv,&tz);
|
||||||
|
// s=tv.tv_usec;s*=0.000001;s+=tv.tv_sec;
|
||||||
|
return (tv.tv_sec*1000+tv.tv_usec/1000);
|
||||||
|
}
|
||||||
|
|
||||||
static unsigned int RelativeTime=0;
|
static unsigned int RelativeTime=0;
|
||||||
|
|
||||||
// Returns time spent between now and last call in seconds
|
// Returns time spent between now and last call in seconds
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
|
|
||||||
void InitTimer();
|
void InitTimer();
|
||||||
unsigned int GetTimer();
|
unsigned int GetTimer();
|
||||||
|
unsigned int GetTimerMS();
|
||||||
//int uGetTimer();
|
//int uGetTimer();
|
||||||
float GetRelativeTime();
|
float GetRelativeTime();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue