viti95 / FastDoom

Doom port for DOS, optimized to be as fast as possible!
528 stars 33 forks source link

Average of frametime since last second #207

Closed tigrouind closed 3 months ago

tigrouind commented 3 months ago

It's based on earlier discussion https://github.com/viti95/FastDoom/discussions/204

The implementation is as simple as it can be : each frame, add current time to a queue, then dequeue elements older than 1 second. FPS is the number of items in the queue. In case of high precision timer, FPS is average of frame times in the queue. Because we remove elements older than 1 second, it's frame rate independent.

Ideas for the future :