#include <winnt.h>
#else
#include <fcntl.h>
- #include <sys/types.h>
- #include <sys/socket.h>
#include <netdb.h>
- #include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#endif
if (a == 0)
{
- usleep(50000);
+ Sleep(50);
a = 1;
}
//---------------------------------------------------------------------------
void Sleep(int ms)
{
-usleep(ms * 1000);
+long long res = ms * 1000000;
+struct timespec ts = {res / 1000000000, res % 1000000000};
+nanosleep(&ts, NULL);
}
//---------------------------------------------------------------------------
long GetTickCount()