Skip to main content

Automatic execution time and memory tracker for Python scripts.

Project description

cntimer ⏱

Automatic execution time and memory tracker for Python scripts.

No code changes. No config. Just install — every script shows timing and memory automatically.


Install

pip install cntimer

Every script you run will show:

────────────────────────────────────────────────────────────
  🕐 Time      21.4 ms       (cpu: 20.9 ms)
  📦 Memory    96 KB         (peak: 19.0 MB)
────────────────────────────────────────────────────────────

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 without any code changes.


Manual install (if auto-install failed)

If you see a warning during pip install, copy cntimer.pth manually.

Step 1 — Find your site-packages path:

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

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

Step 2 — Copy the file:

Mac

cp cntimer.pth /Library/Frameworks/Python.framework/Versions/3.x/lib/python3.x/site-packages/cntimer.pth

Linux

sudo cp cntimer.pth /usr/lib/python3/dist-packages/cntimer.pth

Windows 64-bit (x64) — run Command Prompt as Administrator

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

Windows 32-bit (x86) — run Command Prompt as Administrator

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

Windows ARM64 — run Command Prompt as Administrator

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

Replace 3xx / 3.x with your actual Python version number (e.g. 312 for Python 3.12).

Tip: Not sure which Windows version you have?
Run python -c "import platform; print(platform.architecture(), platform.machine())" — it will tell you.


Uninstall

pip uninstall cntimer

Then delete cntimer.pth from your site-packages folder (same path as above).


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

cntimer-0.1.2.tar.gz (4.6 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.2-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cntimer-0.1.2.tar.gz
  • Upload date:
  • Size: 4.6 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.2.tar.gz
Algorithm Hash digest
SHA256 931bbf432eb22378f3101fd467b3a20c1e3ad57337d8d76bafb62aeb4ef9b2a2
MD5 ff2b4280bd952e3d24b58433b6208514
BLAKE2b-256 2169ec674fd5192b23397cee04d9de03240944702f8bb8a567edcc2aabb6ce77

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cntimer-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 4.7 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3ca06cf7dacc4d05841fef11f20e697040131e05b7534f0d920641e15bbb9c61
MD5 4fb5ca8eb1ac9901c0a42f3b4337317e
BLAKE2b-256 22d5f34f5b0959794c7ca5f6533a611d77d4703145f36560d09d1992435b926a

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