mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Tweaked Timer and TimeSliceThread to reduce the frequency of their calls to wait()
This commit is contained in:
parent
6e7fc1249c
commit
0506bc6100
2 changed files with 31 additions and 28 deletions
|
|
@ -55,12 +55,6 @@ public:
|
|||
{
|
||||
const uint32 now = Time::getMillisecondCounter();
|
||||
|
||||
if (now == lastTime)
|
||||
{
|
||||
wait (1);
|
||||
continue;
|
||||
}
|
||||
|
||||
const int elapsed = (int) (now >= lastTime ? (now - lastTime)
|
||||
: (std::numeric_limits<uint32>::max() - (lastTime - now)));
|
||||
lastTime = now;
|
||||
|
|
@ -98,6 +92,10 @@ public:
|
|||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
wait (1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue