mariadb/windows/sleep.c
Yoni Fogel a9400fb09c closes[t:2427] Fix windows build.
git-svn-id: file:///svn/toku/tokudb@18176 c7de825b-a66e-492c-adef-691d508d4ae1
2013-04-16 23:59:01 -04:00

25 lines
487 B
C

#include <toku_portability.h>
#include <windows.h>
#include <unistd.h>
unsigned int
sleep(unsigned int seconds) {
unsigned int m = seconds / 1000000;
unsigned int n = seconds % 1000000;
unsigned int i;
for (i=0; i<m; i++)
Sleep(1000000*1000);
Sleep(n*1000);
return 0;
}
int
usleep(unsigned int useconds) {
unsigned int m = useconds / 1000;
unsigned int n = useconds % 1000;
if (m == 0 && n > 0)
m = 1;
Sleep(m);
return 0;
}