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-0.1.0.tar.gz
(2.5 kB
view hashes)
Built Distribution
Close
Hashes for frametimer-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7964b8a50c4dc87afefe28a578d25c34e48f718f082ec9982956d34d9163b0fb |
|
MD5 | 260eb4e73de717bc1c879c91154cca97 |
|
BLAKE2b-256 | df483a23c23e20deef3a1ead2552025d4066edc48b153cbb7dfe672243a6e87a |