aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-01-27 17:59:12 +0000
committerGravatar arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-01-27 17:59:12 +0000
commit5786b7ad1ec16c129e6ef1fbd7b6eff1b2cf67f6 (patch)
treec622552304043f15ac83fa1f22cc74e7d1c21f9f
parent52db9b039ad0fe4a6012e52693457bb78f774c37 (diff)
GetTimerMS added - get timer in millisec
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4386 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--linux/timer-lx.c10
-rw-r--r--linux/timer.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/linux/timer-lx.c b/linux/timer-lx.c
index d0164e2d67..2e4ae82ba4 100644
--- a/linux/timer-lx.c
+++ b/linux/timer-lx.c
@@ -28,6 +28,16 @@ unsigned int GetTimer(){
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;
// Returns time spent between now and last call in seconds
diff --git a/linux/timer.h b/linux/timer.h
index 4fe2ab798e..d51155f8a8 100644
--- a/linux/timer.h
+++ b/linux/timer.h
@@ -1,6 +1,7 @@
void InitTimer();
unsigned int GetTimer();
+unsigned int GetTimerMS();
//int uGetTimer();
float GetRelativeTime();