About
Libtcod used to include a global framerate limiter which was eventually deprecated. This module was created as a replacement for that feature.
import time
import tcod.clock
FPS = 30
end_time = time.time() + 3 # Loop for 3 seconds.
clock = tcod.clock.Clock()
while time.time() < end_time:
clock.sync(1 / FPS) # This loop will run at 30 FPS until interrupted.
# Timing information can be checked. Check the docs for more info.
print(f"{clock.last_fps=}")
print(f"{clock.min_fps=}")
print(f"{clock.max_fps=}")
print(f"{clock.mean_fps=}")
print(f"{clock.median_fps=}")
Metadata
Release files for tcod-clock 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| tcod-clock-1.0.1.tar.gz | 12.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tcod_clock-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.5 kB
Release files / tcod-clock-1.0.1.tar.gz
| Download URL | tcod-clock-1.0.1.tar.gz |
|---|---|
| Size | 12.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9f2974beb0cf47239929eefb1e7e1823126e43ce7ecac184736bc70540d310d7
|
|
BLAKE2b-256 checksum How to use checksums |
814b49ccef4579f5023a7150451bf752c8ad08a55701258cf57d3a52d3a7b907
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.28.1
|
Release files / tcod_clock-1.0.1-py3-none-any.whl
| Download URL | tcod_clock-1.0.1-py3-none-any.whl |
|---|---|
| Size | 4.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
80ec3d3948a6397f0e7667612d6c8f786ad9a551f7557b3f2027fc99c8d8ac46
|
|
BLAKE2b-256 checksum How to use checksums |
9aef633aac2b1663b1af760ac201d3f0224f25a3b6417359a729520061ec80fd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.28.1
|