alxhoff / FreeRTOS-Emulator

POSIX based FreeRTOS emulator with SDL2 graphics interface and multiple async communications interfaces, aiming to make it possible to teach FreeRTOS without embedded hardware using similar processes
https://alxhoff.github.io/FreeRTOS-Emulator/
GNU General Public License v3.0
60 stars 105 forks source link

Bugfix: FPS averaging was slightly wrong #81

Closed PhilippvK closed 4 years ago

PhilippvK commented 4 years ago

I stumbled across this as I wrote a short code snipped inspired by the frame rate averaging in the Emulator.

I my opinion the old element has to be removed from the array before the new period is added. Else the value which is subtracted from the total sum is the one index off. This can result in framerates > 50.

PhilippvK commented 4 years ago

Do you think we have to apply this also to the pong example?

alxhoff commented 4 years ago

hmmmm. I'm not bothered :P