Updating built in Io code to use += instead of x = x + y
[io/quag.git] / libs / basekit / source / PortableUsleep.c
blob815a6166417c36026ed166c5fd6bcd4d738140bc
1 int PortableUsleep_justHereToAvoidRanlibWarning(void) { return 0; }
3 #ifdef WIN32
4 #include <windows.h>
6 int usleep(unsigned int us)
8 static LARGE_INTEGER freq;
9 static int initted = 0;
10 LARGE_INTEGER s, e, d;
12 if (!initted)
14 QueryPerformanceFrequency(&freq);
15 initted = 1;
18 QueryPerformanceCounter(&s);
19 d.QuadPart = freq.QuadPart * ((double)us / 1000000.0);
21 do
23 QueryPerformanceCounter(&e);
24 } while (e.QuadPart - s.QuadPart < d.QuadPart);
26 return 0;
30 #endif