mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-06 19:38:14 +00:00
PSP: improve performance counter res to us granularity (thanks @rofl0r!)
This commit is contained in:
@@ -27,23 +27,19 @@
|
|||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <pspthreadman.h>
|
#include <pspthreadman.h>
|
||||||
|
#include <psprtc.h>
|
||||||
|
|
||||||
|
|
||||||
Uint64 SDL_GetPerformanceCounter(void)
|
Uint64 SDL_GetPerformanceCounter(void)
|
||||||
{
|
{
|
||||||
Uint64 ticks;
|
Uint64 ticks;
|
||||||
struct timeval now;
|
sceRtcGetCurrentTick(&ticks);
|
||||||
|
|
||||||
gettimeofday(&now, NULL);
|
|
||||||
ticks = now.tv_sec;
|
|
||||||
ticks *= SDL_US_PER_SECOND;
|
|
||||||
ticks += now.tv_usec;
|
|
||||||
return ticks;
|
return ticks;
|
||||||
}
|
}
|
||||||
|
|
||||||
Uint64 SDL_GetPerformanceFrequency(void)
|
Uint64 SDL_GetPerformanceFrequency(void)
|
||||||
{
|
{
|
||||||
return SDL_US_PER_SECOND;
|
return sceRtcGetTickResolution();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SDL_DelayNS(Uint64 ns)
|
void SDL_DelayNS(Uint64 ns)
|
||||||
|
Reference in New Issue
Block a user