GitHunt
AI

aib/frametimer

An accurate clock/timer for obtaining constant framerates (FPS)

frametimer

An accurate clock/timer that can be used to help obtain constant framerates. It uses a hybrid approach of sleeping for most of the required duration, then spin-waiting for the rest.

Installation

pip install frametimer

(Or just grab the .py file, it's a simple module)

Usage

timer = frametimer.FrameTimer(60)

while run_main_loop:
	dt = timer.tick()

	update(dt)
	...

Languages

Python100.0%

Contributors

MIT License
Created May 5, 2022
Updated December 5, 2025