Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/aib/frametimer


https://github.com/aib/frametimer

Last synced: 3 days ago
JSON representation

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)
...
```