mirror of
https://github.com/love2d/love.git
synced 2026-08-14 10:13:46 +02:00
The video decoding thread efficiently waits for a video to be created before doing anything, rather than sleeping for 2ms in a loop. Reduces the CPU usage of the video worker thread to ~0% when no videos are loaded.
This commit is contained in:
@@ -114,7 +114,7 @@ double Timer::getTimerPeriod()
|
||||
return 0;
|
||||
}
|
||||
|
||||
double Timer::getTimeSinceEpoch()
|
||||
double Timer::getTime()
|
||||
{
|
||||
// The timer period (reciprocal of the frequency.)
|
||||
static const double timerPeriod = getTimerPeriod();
|
||||
@@ -145,10 +145,5 @@ double Timer::getTimeSinceEpoch()
|
||||
#endif
|
||||
}
|
||||
|
||||
double Timer::getTime() const
|
||||
{
|
||||
return getTimeSinceEpoch();
|
||||
}
|
||||
|
||||
} // timer
|
||||
} // love
|
||||
|
||||
@@ -76,8 +76,7 @@ public:
|
||||
* and increases monotonically.
|
||||
* @return The time (in seconds)
|
||||
**/
|
||||
virtual double getTime() const;
|
||||
static double getTimeSinceEpoch();
|
||||
static double getTime();
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user