mirror of
https://github.com/OpenMW/openmw.git
synced 2025-04-10 09:06:42 +00:00
Support frequency of ProgressReporter calls lower than interval
This commit is contained in:
parent
088c459771
commit
a2002bc983
1 changed files with 3 additions and 3 deletions
|
@ -29,10 +29,10 @@ namespace Misc
|
||||||
{
|
{
|
||||||
const std::lock_guard lock(mMutex);
|
const std::lock_guard lock(mMutex);
|
||||||
const auto now = std::chrono::steady_clock::now();
|
const auto now = std::chrono::steady_clock::now();
|
||||||
const auto left = mNextReport - now;
|
if (mNextReport > now || provided == expected)
|
||||||
if (left.count() > 0 || provided == expected)
|
|
||||||
return false;
|
return false;
|
||||||
mNextReport += mInterval + left;
|
if (mInterval.count() > 0)
|
||||||
|
mNextReport = mNextReport + mInterval * ((now - mNextReport + mInterval).count() / mInterval.count());
|
||||||
return true;
|
return true;
|
||||||
} ();
|
} ();
|
||||||
if (shouldReport)
|
if (shouldReport)
|
||||||
|
|
Loading…
Reference in a new issue