23 #ifndef __LIBRETRO_COMMON_TIMERS_H 24 #define __LIBRETRO_COMMON_TIMERS_H 28 #if defined(__CELLOS_LV2__) && !defined(__PSL1GHT__) 29 #include <sys/timer.h> 31 #include <time/time.h> 32 #elif defined(GEKKO) || defined(__PSL1GHT__) || defined(__QNX__) 37 #include <pspthreadman.h> 39 #include <psp2/kernel/threadmgr.h> 41 #include <SDL/SDL_timer.h> 48 #if defined(_WIN32) && !defined(_XBOX) 49 #define WIN32_LEAN_AND_MEAN 51 #elif defined(_WIN32) && defined(_XBOX) 63 #define timespec timeval 64 #define tv_nsec tv_usec 67 extern int nanosleep(
const struct timespec *rqtp,
struct timespec *rmtp);
69 static int nanosleepDOS(
const struct timespec *rqtp,
struct timespec *rmtp)
71 usleep(1000000 * rqtp->tv_sec + rqtp->tv_nsec / 1000);
74 rmtp->tv_sec = rmtp->tv_nsec=0;
79 #define nanosleep nanosleepDOS 90 #if defined(__CELLOS_LV2__) && !defined(__PSL1GHT__) 91 sys_timer_usleep(1000 * msec);
92 #elif defined(PSP) || defined(VITA) 93 sceKernelDelayThread(1000 * msec);
97 svcSleepThread(1000000 * (
s64)msec);
98 #elif defined(__WINRT__) || defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP 100 #elif defined(_WIN32) 104 #elif defined(GEKKO) || defined(__PSL1GHT__) || defined(__QNX__) 109 struct timespec tv = {0};
110 tv.tv_sec = msec / 1000;
111 tv.tv_nsec = (msec % 1000) * 1000000;
#define INLINE
Definition: retro_inline.h:35
#define FALSE
Definition: stb_vorbis.h:232
#define ms_to_ticks(ms)
Definition: time.h:18
static INLINE void retro_sleep(unsigned msec)
Definition: retro_timers.h:88
int usleep(useconds_t microseconds)
Definition: missing_libc_functions.c:22
#define NULL
Pointer to 0.
Definition: gctypes.h:65
int nanosleep(struct timespec *tb)
void OSSleepTicks(OSTime ticks)
int64_t s64
64bit signed integer
Definition: gctypes.h:25