Skip to main content

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

frametimer-1.1.0.tar.gz (2.6 kB view hashes)

Uploaded Source

Built Distribution

frametimer-1.1.0-py3-none-any.whl (3.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page