An accurate clock/timer for obtaining constant framerates (FPS)
Project description
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)
...
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
frametimer-1.1.0.tar.gz
(2.6 kB
view hashes)
Built Distribution
Close
Hashes for frametimer-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2042418d0e4fd86d600249663b4d217cba269bece741b5255102ab6e431164a4 |
|
MD5 | 5b75fbea4da347410a36b8a4d7a82d24 |
|
BLAKE2b-256 | 88ac31640b09c6e6e4b498d46ca075a78bbc8a6bcb2c265fc47c4c2006c7349e |