Mercurial > mplayer.hg
changeset 4385:7bb8f7905000
GetTimerMS added - get timer in millisec
author | arpi |
---|---|
date | Sun, 27 Jan 2002 17:59:12 +0000 |
parents | a1d27234018f |
children | 09f77684a676 |
files | linux/timer-lx.c linux/timer.h |
diffstat | 2 files changed, 11 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/linux/timer-lx.c Sun Jan 27 17:21:20 2002 +0000 +++ b/linux/timer-lx.c Sun Jan 27 17:59:12 2002 +0000 @@ -28,6 +28,16 @@ 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