blob: b84cfde1d91c77a59b88e5323f99976f98318cce [file] [log] [blame] [raw]
#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;
}