mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-09-07 09:05:57 -05:00
do not sleep less than 1ms (#82)
This commit is contained in:
@@ -354,8 +354,11 @@ void SwitcherData::Thread()
|
||||
} else {
|
||||
duration =
|
||||
std::chrono::milliseconds(interval) - runTime;
|
||||
if (duration.count() < 0)
|
||||
duration = std::chrono::milliseconds(0);
|
||||
if (duration.count() < 1) {
|
||||
blog(LOG_INFO,
|
||||
"detected busy loop - refusing to sleep less than 1ms");
|
||||
duration = std::chrono::milliseconds(50);
|
||||
}
|
||||
}
|
||||
|
||||
//sleep for a bit
|
||||
|
||||
Reference in New Issue
Block a user