mirror of
https://github.com/encounter/SDL.git
synced 2025-05-20 14:21:25 +00:00
Work around the lack of clock() on PS Vita
This commit is contained in:
parent
25367efcba
commit
0a93ac1294
@ -349,7 +349,7 @@ static void SDLTest_LogTestSuiteSummary(SDLTest_TestSuiteReference *testSuites)
|
|||||||
/* Gets a timer value in seconds */
|
/* Gets a timer value in seconds */
|
||||||
static float GetClock()
|
static float GetClock()
|
||||||
{
|
{
|
||||||
float currentClock = clock() / (float) CLOCKS_PER_SEC;
|
float currentClock = SDL_GetPerformanceCounter() / (float) SDL_GetPerformanceFrequency();
|
||||||
return currentClock;
|
return currentClock;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ void SDLTest_RandomInitTime(SDLTest_RandomContext * rndContext)
|
|||||||
|
|
||||||
srand((unsigned int)time(NULL));
|
srand((unsigned int)time(NULL));
|
||||||
a=rand();
|
a=rand();
|
||||||
srand((unsigned int)clock());
|
srand((unsigned int)SDL_GetPerformanceCounter());
|
||||||
b=rand();
|
b=rand();
|
||||||
SDLTest_RandomInit(rndContext, a, b);
|
SDLTest_RandomInit(rndContext, a, b);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user