File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -402,10 +402,8 @@ struct Plugify::Impl {
402402 manager.Update (deltaTime);
403403
404404 // Sleep for remaining time
405- auto updateDuration = std::chrono::steady_clock::now () - now;
406- auto sleepTime = interval
407- - std::chrono::duration_cast<std::chrono::milliseconds>(updateDuration
408- );
405+ auto updateDuration = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now () - now);
406+ auto sleepTime = interval - updateDuration;
409407
410408 if (sleepTime > 0ms) {
411409 // Use interruptible sleep
@@ -417,7 +415,7 @@ struct Plugify::Impl {
417415 logger->Log (
418416 std::format (
419417 " Update took longer than interval: {} > {}" ,
420- std::chrono::duration_cast<std::chrono::milliseconds>( updateDuration) ,
418+ updateDuration,
421419 interval
422420 ),
423421 Severity::Warning
You can’t perform that action at this time.
0 commit comments