Skip to content
This repository has been archived by the owner on Sep 21, 2020. It is now read-only.

Commit

Permalink
Don't allow update intervals slower than 1 second.
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterJohnson committed Sep 6, 2015
1 parent 123ba9c commit e1efb73
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Dispatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,11 @@ void DispatcherBase::Stop() {
}

void DispatcherBase::SetUpdateRate(double interval) {
// don't allow update rates faster than 100 ms
// don't allow update rates faster than 100 ms or slower than 1 second
if (interval < 0.1)
interval = 0.1;
else if (interval > 1.0)
interval = 1.0;
m_update_rate = static_cast<unsigned int>(interval * 1000);
}

Expand Down

0 comments on commit e1efb73

Please sign in to comment.