Skip to main content

timifypy

A tiny, clean, and useful timing utility for Python.

Measure execution time effortlessly with a context manager or a manual stopwatch.


🚀 Installation

pip install timifypy


## Advanced Usage

### ⏱ Manual Stopwatch
```python
from timifypy import Stopwatch
sw = Stopwatch()

sw.start()
# some heavy computation
sum(range(1000000))
sw.stop()

print(sw)          # e.g., <Stopwatch 12.34 ms>
print(sw.elapsed)  # raw seconds


##Basic Usage
from timifypy import Stopwatch

sw = Stopwatch()

sw.start()
# some heavy computation
sum(range(1000000))
sw.stop()

print(sw)          # e.g., <Stopwatch 12.34 ms>
print(sw.elapsed)  # raw seconds


#Context Manager
from timifypy import timer

with timer("example computation"):
    sum(range(1000000))


##Context Manager with Logging
from timifypy import timer

with timer("load data", log_file="timings.log"):
    sum(range(1000000))


#Multiple Timers
from timifypy import timer

with timer("step 1"):
    sum(range(500000))

with timer("step 2"):
    sum(range(500000, 1000000))


##Using Stopwatch for Multiple Steps
from timifypy import Stopwatch

sw = Stopwatch()

sw.start()
sum(range(500000))
sw.stop()
print("Step 1:", sw)

sw.start()
sum(range(500000, 1000000))
sw.stop()
print("Step 2:", sw)

print("Total elapsed:", sw.elapsed)

Metadata

Release files for timifypy 0.1.1

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

Source distribution (sdist)

Source distribution for timifypy 0.1.1
File Size Uploaded
timifypy-0.1.1.tar.gz 2.5 kB Details

Built distribution (wheel)

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

Total release size: 5.7 kB

Release files / timifypy-0.1.1.tar.gz

Download URL timifypy-0.1.1.tar.gz
Size 2.5 kB
Tags Source
SHA-256 checksum
How to use checksums
35d0f3ec2f2a8458f736a0b5dddf1fc8f5dc7f2f309063226e5518237fd1dd0b
BLAKE2b-256 checksum
How to use checksums
6efaf79db7b88efb55c5a65d2561b0ae24d4a5a3b53be41b456a90440793caf8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.9

Release files / timifypy-0.1.1-py3-none-any.whl

Download URL timifypy-0.1.1-py3-none-any.whl
Size 3.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
317311ef49424b31cc3d55d889009a8f6a2d2643c6efc8413898579578f62b96
BLAKE2b-256 checksum
How to use checksums
dfa168ef40a03e38528e5b5e1484bd1799834dae93cd98bdb2af856040050457
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.9

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.0.0

2 release files

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