1 // Precise timer routines for WINDOWS
7 const char *timer_name
= "Windows native";
9 // Returns current time in microseconds
10 unsigned int GetTimer(void)
12 return timeGetTime() * 1000;
15 // Returns current time in milliseconds
16 unsigned int GetTimerMS(void)
18 return timeGetTime() ;
21 int usec_sleep(int usec_delay
){
22 // Sleep(0) won't sleep for one clocktick as the unix usleep
23 // instead it will only make the thread ready
24 // it may take some time until it actually starts to run again
25 if(usec_delay
<1000)usec_delay
=1000;
26 Sleep( usec_delay
/1000);
30 static DWORD RelativeTime
= 0;
32 float GetRelativeTime(void)
38 return (float) r
*0.000001F
;