win.c 332 B

1234567891011121314151617
  1. #include "win.h"
  2. #ifdef _MSC_VER
  3. #include <windows.h>
  4. void usleep(__int64 usec){
  5. HANDLE timer;
  6. LARGE_INTEGER ft;
  7. ft.QuadPart = -(10*usec);
  8. timer = CreateWaitableTimer(NULL, TRUE, NULL);
  9. SetWaitableTimer(timer, &ft, 0, NULL, NULL, 0);
  10. WaitForSingleObject(timer, INFINITE);
  11. CloseHandle(timer);
  12. }
  13. #endif