Skip to main content

Automatic execution time and memory tracker for Python scripts — works with VSCode, terminal, and every Python runner automatically.

Project description

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      1.2 ms        (execution: 3.06 s)
  📦 Memory    4 KB          (peak: 197 KB)
────────────────────────────────────────────────────────────

How it works

When you pip install cntimer, it 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.

  • ✅ Works with VSCode Run button
  • ✅ Works in terminal
  • ✅ Works on Windows (x86, x64, ARM64), macOS, Linux
  • ✅ No imports needed in your code

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

Time shows pure CPU time (perfect for competitive programming).
execution shows total wait time including delays.


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

License

MIT © 2026 tokitahmidtoufa

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

cntimer-0.1.9.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

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

cntimer-0.1.9-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file cntimer-0.1.9.tar.gz.

File metadata

  • Download URL: cntimer-0.1.9.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for cntimer-0.1.9.tar.gz
Algorithm Hash digest
SHA256 6c170fcf91619dbf7d1c98f820667441d331018a0ad8c9f8ada1e51509fd5258
MD5 b77bccd6e20ae8c0b4dd4b004ce1252c
BLAKE2b-256 6916b0a5bf9c9335d1c6623bfbcb8652166333f240f068b5c923cc511ae4d904

See more details on using hashes here.

File details

Details for the file cntimer-0.1.9-py3-none-any.whl.

File metadata

  • Download URL: cntimer-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for cntimer-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 537e7e04dea3a6f361c687e6cc68551f523f74d7c99d973ca3480cd4a5ee01ed
MD5 77709efdb650f34d14414fa34544e36b
BLAKE2b-256 7218523671dac374d4afc801eac21b04325001ecfbb01f375b4f454a5426feb0

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