mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-05 15:55:45 +00:00
Support frequency of ProgressReporter calls lower than interval
This commit is contained in:
parent
088c459771
commit
a2002bc983
@ -29,10 +29,10 @@ namespace Misc
|
||||
{
|
||||
const std::lock_guard lock(mMutex);
|
||||
const auto now = std::chrono::steady_clock::now();
|
||||
const auto left = mNextReport - now;
|
||||
if (left.count() > 0 || provided == expected)
|
||||
if (mNextReport > now || provided == expected)
|
||||
return false;
|
||||
mNextReport += mInterval + left;
|
||||
if (mInterval.count() > 0)
|
||||
mNextReport = mNextReport + mInterval * ((now - mNextReport + mInterval).count() / mInterval.count());
|
||||
return true;
|
||||
} ();
|
||||
if (shouldReport)
|
||||
|
Loading…
Reference in New Issue
Block a user