https://github.com/aib/frametimer
https://github.com/aib/frametimer
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/aib/frametimer
- Owner: aib
- License: mit
- Created: 2022-05-05T08:29:56.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2022-06-25T05:32:03.000Z (about 3 years ago)
- Last Synced: 2025-02-20T09:31:18.789Z (5 months 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)
...
```