Skip to content

Simplify fps computation#2752

Merged
j9ac9k merged 7 commits intopyqtgraph:masterfrom
pijyoi:alternate_fps
Jun 27, 2023
Merged

Simplify fps computation#2752
j9ac9k merged 7 commits intopyqtgraph:masterfrom
pijyoi:alternate_fps

Conversation

@pijyoi
Copy link
Copy Markdown
Contributor

@pijyoi pijyoi commented Jun 22, 2023

Various examples compute fps by measuring the inverse time elapsed of each frame. As there is quite a bit of jitter, the fps value is then smoothed using some rolling average.

This PR simplifies the computation by counting the number of frames that have been updated over a period of 1 second. The longish duration serves to average out the jitter and removes the need for accurate time measurement of the time elapsed of each update.

@pijyoi pijyoi force-pushed the alternate_fps branch 2 times, most recently from 224bd1f to 45348aa Compare June 23, 2023 12:01
@j9ac9k
Copy link
Copy Markdown
Member

j9ac9k commented Jun 27, 2023

Love this diff, especially love doing away w/ the .processEvents() calls...I'll have to rework #2418 a fair amount but this PR makes that much easier.

Merging, thanks @pijyoi

@j9ac9k j9ac9k merged commit fd84f62 into pyqtgraph:master Jun 27, 2023
@pijyoi pijyoi deleted the alternate_fps branch June 27, 2023 04:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants