mirror of
https://github.com/love2d/love.git
synced 2026-08-15 07:41:11 +02:00
Make getTime() relative to first invocation
This commit is contained in:
@@ -123,7 +123,7 @@ double Timer::getTimerPeriod()
|
||||
return 0;
|
||||
}
|
||||
|
||||
double Timer::getTime()
|
||||
double Timer::getTimeAbsolute()
|
||||
{
|
||||
// The timer period (reciprocal of the frequency.)
|
||||
static const double timerPeriod = getTimerPeriod();
|
||||
@@ -156,5 +156,11 @@ double Timer::getTime()
|
||||
#endif
|
||||
}
|
||||
|
||||
double Timer::getTime()
|
||||
{
|
||||
static const double start = getTimeAbsolute();
|
||||
return getTimeAbsolute() - start;
|
||||
}
|
||||
|
||||
} // timer
|
||||
} // love
|
||||
|
||||
Reference in New Issue
Block a user