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-2.0.0.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

frametimer-2.0.0-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file frametimer-2.0.0.tar.gz.

File metadata

  • Download URL: frametimer-2.0.0.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for frametimer-2.0.0.tar.gz
Algorithm Hash digest
SHA256 5a9285923cd4c5f7bc7f8f55ba7987f737035326dc3082f57a46d439868927e6
MD5 0b450c8fcfcdfa3c0b3b4ea9ccc3a4e3
BLAKE2b-256 968baf9596b1751a6f211a438fd602f7766f39fd15cdd38c3b9e1d41eac51eb9

See more details on using hashes here.

File details

Details for the file frametimer-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: frametimer-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 3.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for frametimer-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0341ba3e174bdcd996c7368272fffd329a0102aaa383078df9d2edb53cadf2a3
MD5 ade8fee42e963b394fea5e8266f6c53c
BLAKE2b-256 424302fb8596a3b28eb8033da2cdf7afc5f627cf1227b59626227f3e8418af7f

See more details on using hashes here.

Supported by

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