Works now with Windows Visual Studio C++ too
[owTools.git] / src / owDevice.cpp
index 70fe96a..070ec40 100755 (executable)
 
 
 #include "owInterface.h"
+#ifdef LINUX
 #include <unistd.h>
-
+#endif
+#ifdef WIN
+void usleep(int waitTime) {\r
+       __int64 time1 = 0, time2 = 0, freq = 0;\r
+\r
+       QueryPerformanceCounter((LARGE_INTEGER *)&time1);\r
+       QueryPerformanceFrequency((LARGE_INTEGER *)&freq);\r
+\r
+       do {\r
+               QueryPerformanceCounter((LARGE_INTEGER *)&time2);\r
+       } while ((time2 - time1) < waitTime);\r
+}
+#endif
 owDevice::owDevice(owInterface *owi_,snum_t num) {
                snum=num;
                owi=owi_;