diff --git a/raknet/RakSleep.cpp b/raknet/RakSleep.cpp new file mode 100644 index 0000000..e4b843f --- /dev/null +++ b/raknet/RakSleep.cpp @@ -0,0 +1,18 @@ +#if defined(_COMPATIBILITY_1) +#include "Compatibility1Includes.h" +#elif defined(_WIN32) +#include // Sleep +#elif defined(_COMPATIBILITY_2) +#include "Compatibility2Includes.h" +#else +#include // usleep +#endif + +void RakSleep(unsigned int ms) +{ +#ifdef _WIN32 + Sleep(ms); +#else + usleep(ms * 1000); +#endif +} diff --git a/raknet/RakSleep.h b/raknet/RakSleep.h new file mode 100644 index 0000000..8bbfc37 --- /dev/null +++ b/raknet/RakSleep.h @@ -0,0 +1,6 @@ +#ifndef __RAK_SLEEP_H +#define __RAK_SLEEP_H + +void RakSleep(unsigned int ms); + +#endif