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
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file frametimer-2.0.0.tar.gz.
File metadata
- Download URL: frametimer-2.0.0.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a9285923cd4c5f7bc7f8f55ba7987f737035326dc3082f57a46d439868927e6
|
|
| MD5 |
0b450c8fcfcdfa3c0b3b4ea9ccc3a4e3
|
|
| BLAKE2b-256 |
968baf9596b1751a6f211a438fd602f7766f39fd15cdd38c3b9e1d41eac51eb9
|
File details
Details for the file frametimer-2.0.0-py3-none-any.whl.
File metadata
- Download URL: frametimer-2.0.0-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0341ba3e174bdcd996c7368272fffd329a0102aaa383078df9d2edb53cadf2a3
|
|
| MD5 |
ade8fee42e963b394fea5e8266f6c53c
|
|
| BLAKE2b-256 |
424302fb8596a3b28eb8033da2cdf7afc5f627cf1227b59626227f3e8418af7f
|