mirror of
https://github.com/dashr9230/SA-MP.git
synced 2024-12-22 22:47:29 +08:00
[raknet] Implement RakSleep
This commit is contained in:
parent
a89c9b75f9
commit
a50b453784
18
raknet/RakSleep.cpp
Normal file
18
raknet/RakSleep.cpp
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#if defined(_COMPATIBILITY_1)
|
||||||
|
#include "Compatibility1Includes.h"
|
||||||
|
#elif defined(_WIN32)
|
||||||
|
#include <windows.h> // Sleep
|
||||||
|
#elif defined(_COMPATIBILITY_2)
|
||||||
|
#include "Compatibility2Includes.h"
|
||||||
|
#else
|
||||||
|
#include <unistd.h> // usleep
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void RakSleep(unsigned int ms)
|
||||||
|
{
|
||||||
|
#ifdef _WIN32
|
||||||
|
Sleep(ms);
|
||||||
|
#else
|
||||||
|
usleep(ms * 1000);
|
||||||
|
#endif
|
||||||
|
}
|
6
raknet/RakSleep.h
Normal file
6
raknet/RakSleep.h
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#ifndef __RAK_SLEEP_H
|
||||||
|
#define __RAK_SLEEP_H
|
||||||
|
|
||||||
|
void RakSleep(unsigned int ms);
|
||||||
|
|
||||||
|
#endif
|
Loading…
Reference in New Issue
Block a user