# HG changeset patch # User arpi # Date 1012154352 0 # Node ID 7bb8f79050009a290ea758232350dc376f506b3c # Parent a1d27234018fe8718153b0db603bb170f7ac6218 GetTimerMS added - get timer in millisec diff -r a1d27234018f -r 7bb8f7905000 linux/timer-lx.c --- 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 diff -r a1d27234018f -r 7bb8f7905000 linux/timer.h --- a/linux/timer.h Sun Jan 27 17:21:20 2002 +0000 +++ b/linux/timer.h Sun Jan 27 17:59:12 2002 +0000 @@ -1,6 +1,7 @@ void InitTimer(); unsigned int GetTimer(); +unsigned int GetTimerMS(); //int uGetTimer(); float GetRelativeTime();