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();