mirror of
https://github.com/love2d/love.git
synced 2026-08-16 08:11:02 +02:00
Make love.timer.getFPS and love.timer.getAverageDelta microsecond-accurate
This commit is contained in:
@@ -71,12 +71,12 @@ void Timer::step()
|
||||
prevTime = currTime;
|
||||
|
||||
// Get ticks from SDL
|
||||
currTime = SDL_GetTicks();
|
||||
currTime = getMicroTime();
|
||||
|
||||
// Convert to number of seconds
|
||||
dt = (currTime - prevTime)/1000.0;
|
||||
dt = currTime - prevTime;
|
||||
|
||||
double timeSinceLast = (currTime - prevFpsUpdate)/1000.0;
|
||||
double timeSinceLast = currTime - prevFpsUpdate;
|
||||
// Update FPS?
|
||||
if (timeSinceLast > fpsUpdateFrequency)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user