diff options
Diffstat (limited to 'linux/timer-lx.c')
-rw-r--r-- | linux/timer-lx.c | 10 |
1 files changed, 10 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 |