Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aib/frametimer
https://github.com/aib/frametimer
Last synced: 3 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/aib/frametimer
- Owner: aib
- License: mit
- Created: 2022-05-05T08:29:56.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-06-25T05:32:03.000Z (over 2 years ago)
- Last Synced: 2025-01-08T12:13:21.224Z (6 days ago)
- Language: Python
- Size: 8.79 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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
```python
timer = frametimer.FrameTimer(60)while run_main_loop:
dt = timer.tick()update(dt)
...
```