#include <windows.h> | |
#include <nt.h> | |
//#include <errno.h> | |
int usleep(unsigned long int useconds) { | |
LARGE_INTEGER interval; | |
interval.QuadPart = -(unsigned long long int)useconds * 10; | |
long int status = NtDelayExecution(1, &interval); | |
//return ntstatus_to_errno(status) ? 0 : -1; | |
return status < 0 ? 0 : -1; | |
} | |
unsigned int sleep(unsigned int seconds) { | |
usleep(seconds * 1000000); | |
return 0; | |
} |