mosra / magnum

Lightweight and modular C++11 graphics middleware for games and data visualization
https://magnum.graphics/
Other
4.74k stars 439 forks source link

add simple timer functionality to Timeline #604

Closed sthalik closed 1 year ago

sthalik commented 1 year ago

The Timeline class already has all the data it needs to act as a stopwatch timer.

One example use-case is jitter-correcting framerate throttling when minimized or lacking window focus.

codecov[bot] commented 1 year ago

Codecov Report

Base: 81.26% // Head: 81.25% // Decreases project coverage by -0.00% :warning:

Coverage data is based on head (82cb0e8) compared to base (852fd16). Patch coverage: 0.00% of modified lines in pull request are covered.

:exclamation: Current head 82cb0e8 differs from pull request most recent head 99ce05e. Consider uploading reports for the commit 99ce05e to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #604 +/- ## ========================================== - Coverage 81.26% 81.25% -0.01% ========================================== Files 532 532 Lines 38965 38968 +3 ========================================== Hits 31665 31665 - Misses 7300 7303 +3 ``` | [Impacted Files](https://codecov.io/gh/mosra/magnum/pull/604?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Vladim%C3%ADr+Vondru%C5%A1) | Coverage Δ | | |---|---|---| | [src/Magnum/Timeline.cpp](https://codecov.io/gh/mosra/magnum/pull/604/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Vladim%C3%ADr+Vondru%C5%A1#diff-c3JjL01hZ251bS9UaW1lbGluZS5jcHA=) | `0.00% <0.00%> (ø)` | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Vladim%C3%ADr+Vondru%C5%A1). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Vladim%C3%ADr+Vondru%C5%A1)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

mosra commented 1 year ago

Merged as 28999d113ada927aeed9de4bc26c48217dbeb585, thanks!

This class was quite neglected so I attempted adding a test as well... and then the CIs were way more flaky than expected, so it took quite some time to get passing.