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