1
0
Fork 0
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:
jules 2015-10-27 11:49:06 +00:00
parent 6e7fc1249c
commit 0506bc6100
2 changed files with 31 additions and 28 deletions

View file

@ -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
{