Skip to main content

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

Metadata

Release files for frametimer 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for frametimer 2.0.0
File Size Uploaded
frametimer-2.0.0.tar.gz 3.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for frametimer 2.0.0
File Interpreter ABI Platform
frametimer-2.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 7.3 kB

Release files / frametimer-2.0.0.tar.gz

Download URL frametimer-2.0.0.tar.gz
Size 3.5 kB
Tags Source
SHA-256 checksum
How to use checksums
5a9285923cd4c5f7bc7f8f55ba7987f737035326dc3082f57a46d439868927e6
BLAKE2b-256 checksum
How to use checksums
968baf9596b1751a6f211a438fd602f7766f39fd15cdd38c3b9e1d41eac51eb9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / frametimer-2.0.0-py3-none-any.whl

Download URL frametimer-2.0.0-py3-none-any.whl
Size 3.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0341ba3e174bdcd996c7368272fffd329a0102aaa383078df9d2edb53cadf2a3
BLAKE2b-256 checksum
How to use checksums
424302fb8596a3b28eb8033da2cdf7afc5f627cf1227b59626227f3e8418af7f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page