Skip to main content

Limit while loop at certain fps rate.

Project description

Limit while loop at certain fps rate

Installation

pip install fps-limiter

Examples

Example #1

from fps_limiter import LimitFPS, FPSCounter

fps_limiter = LimitFPS(fps=15)
fps_counter = FPSCounter()

while True:
    if fps_limiter():
        print("current fps: %s" % fps_counter())

Example #2

from fps_limiter import LimitFPS, FPSCounter

fps_limiter = LimitFPS(fps=15)

while True:
    if fps_limiter():
        print("elapsed seconds: %s" % fps_limiter.get_elapsed_seconds())

License

MIT

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

fps-limiter-0.1.1.tar.gz (1.5 kB view hashes)

Uploaded Source

Built Distribution

fps_limiter-0.1.1-py3-none-any.whl (2.8 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