diff linux/timer-lx.c @ 4385:7bb8f7905000

GetTimerMS added - get timer in millisec
author arpi
date Sun, 27 Jan 2002 17:59:12 +0000
parents 57abb24ac58b
children f297030ef5ab
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