diff --git a/Concurrency/BestEffortUpdater.cpp b/Concurrency/BestEffortUpdater.cpp index ce8e6041d..3d452a081 100644 --- a/Concurrency/BestEffortUpdater.cpp +++ b/Concurrency/BestEffortUpdater.cpp @@ -39,7 +39,9 @@ void BestEffortUpdater::update() { const int64_t integer_duration = std::chrono::duration_cast(elapsed).count(); if(integer_duration > 0) { if(delegate_) { - const double duration = static_cast(integer_duration) / 1e9; + // Cap running at 1/5th of a second, to avoid doing a huge amount of work after any + // brief system interruption. + const double duration = std::min(static_cast(integer_duration) / 1e9, 0.2); delegate_->update(this, duration, has_skipped_); } has_skipped_ = false;