From 5786b7ad1ec16c129e6ef1fbd7b6eff1b2cf67f6 Mon Sep 17 00:00:00 2001 From: arpi Date: Sun, 27 Jan 2002 17:59:12 +0000 Subject: GetTimerMS added - get timer in millisec git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4386 b3059339-0415-0410-9bf9-f77b7e298cf2 --- linux/timer-lx.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'linux/timer-lx.c') 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 -- cgit v1.2.3