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 details)
Built Distribution
File details
Details for the file frametimer-1.1.0.tar.gz
.
File metadata
- Download URL: frametimer-1.1.0.tar.gz
- Upload date:
- Size: 2.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 049e983fc671d32eb3a696d6268745b92431bed24437ac0b1ae9504a86f2d331 |
|
MD5 | 94b4f052ac79e4a5065b9c4cb9b0df54 |
|
BLAKE2b-256 | 00cd447523065f3f153444f6afda4f9c163a04bec9aef768a3497fc6d26eeecf |
File details
Details for the file frametimer-1.1.0-py3-none-any.whl
.
File metadata
- Download URL: frametimer-1.1.0-py3-none-any.whl
- Upload date:
- Size: 3.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2042418d0e4fd86d600249663b4d217cba269bece741b5255102ab6e431164a4 |
|
MD5 | 5b75fbea4da347410a36b8a4d7a82d24 |
|
BLAKE2b-256 | 88ac31640b09c6e6e4b498d46ca075a78bbc8a6bcb2c265fc47c4c2006c7349e |