Skip to main content

cntimer ⏱

PyPI version License: MIT Python 3.7+ Platform

Automatic execution time and memory tracker for Python scripts.

No code changes. No config. Just pip install cntimer — every script you run will automatically show timing and memory at the end, whether you use VSCode, terminal, or any Python runner.


Install

pip install cntimer

That's it. Every Python script you run will show this automatically:

────────────────────────────────────────────────────────────
  🕐 Time      0.74 ms        (execution: 1.44 s)
  📦 Memory    31.2 MB       (peak: 62.4 MB)
────────────────────────────────────────────────────────────

✅ Works in base Python, virtual environments (venv), conda, and pipx — no extra steps needed.


How it works

cntimer places a cntimer.pth file into your Python's site-packages directory. Python automatically reads all .pth files on every startup — which is what makes tracking work with zero code changes.

When you uninstall with pip uninstall cntimer, the .pth hook removes itself automatically on the next Python startup — no orphaned files, no errors.

  • ✅ Works with VSCode Run button
  • ✅ Works in terminal
  • ✅ Works in virtual environments (venv, conda, pipx)
  • ✅ Works on Windows (x86, x64, ARM64), macOS, Linux
  • ✅ No imports needed in your code
  • ✅ Cleans up after itself on uninstall

Output explained

Field Meaning
🕐 Time CPU time — actual computation (excludes sleep, I/O, network wait)
execution Total execution time (how long you waited)
📦 Memory Memory still in use when script finished
peak Highest memory used at any point during execution

If Time is much bigger than cpu, your script spent time waiting (file I/O, network, sleep).
If they're close, your script is CPU-bound (pure computation).


Manual install (if auto-install failed)

Find your site-packages path:

# Mac / Linux
python3 -c "import site; print(site.getsitepackages()[0])"

# Windows
python -c "import site; print(site.getsitepackages()[0])"

Then copy the file:

macOS

cp cntimer.pth $(python3 -c "import site; print(site.getsitepackages()[0])")/cntimer.pth

Linux

sudo cp cntimer.pth $(python3 -c "import site; print(site.getsitepackages()[0])")/cntimer.pth

Windows 64-bit / ARM64 — run Command Prompt as Administrator

copy cntimer.pth "C:\Program Files\Python3xx\Lib\site-packages\cntimer.pth"

Windows 32-bit — run Command Prompt as Administrator

copy cntimer.pth "C:\Program Files (x86)\Python3xx\Lib\site-packages\cntimer.pth"

Replace 3xx with your Python version (e.g. 312 for Python 3.12).


Uninstall

pip uninstall cntimer

The .pth hook removes itself automatically on the next Python startup. No manual cleanup needed.


License

MIT © 2026 tokitahmidtoufa

Metadata

Release files for cntimer 0.1.11

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

Source distribution (sdist)

Source distribution for cntimer 0.1.11
File Size Uploaded Provenance Actions
cntimer-0.1.11.tar.gz 7.0 kB Without provenance Details for cntimer-0.1.11.tar.gz

Built distribution (wheel)

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

Total release size: 14.5 kB

Release files / cntimer-0.1.11.tar.gz

Download URL cntimer-0.1.11.tar.gz
Size 7.0 kB
Tags Source
SHA-256 checksum
How to use checksums
27acc4042825549818958df4ba98a23a0d9299831a77052b67d77b5e987730a5
BLAKE2b-256 checksum
How to use checksums
ef36cb9f7728b81dc5467a09b2d6484371548568923656a3614759fa15a43769
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release files / cntimer-0.1.11-py3-none-any.whl

Download URL cntimer-0.1.11-py3-none-any.whl
Size 7.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
43fe227c6d4379e4bbb1748baedd50a5adb20856dcbdaf38e6603fca74fe460b
BLAKE2b-256 checksum
How to use checksums
dfde7253e3b206681c8765c0fc02cecfd825cc467ce11ff79ae28aa2f1a4b694
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Security for cntimer 0.1.11

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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