mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-04-19 00:27:23 -05:00
do not sleep less than 1ms (#82)
This commit is contained in:
parent
faca5f8863
commit
07b95cb8ae
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user