timeit_resource
timeit_resource: Python Resource to easily capture and report time consumed by code snippets.
Here is the GitHub repo:
Here is the pip command to install it:
pip install timeit_resource
Here’s a simple example of how you might use timeit_resource:
# Write time elapsed information to stdout, with default title (prefix)
with TimeIt() as timer:
# Your time-consuming code here
for _ in range(1000000):
pass
Here are examples that further explore using timeit_resource:
TimeIt.prefix = ' '
# Write to stdout, nested
with TimeIt("Total time taken"):
from time import sleep
for _ in range(10):
with TimeIt("Time taken - outer"):
for _ in range(10):
with TimeIt("Time taken - inner"):
sleep(0.01)
# Append to output.txt
with TimeIt(title="Time taken", output="output.txt") as t:
# Your time-consuming code here
for _ in range(1000000):
pass
# Write to stderr
with TimeIt(output=sys.stderr) as t:
# Your time-consuming code here
for _ in range(1000000):
pass
# Write to an output stream that the client owns!
with open("output.txt", 'w') as f:
with TimeIt(output=f) as t:
# Your time-consuming code here
for _ in range(1000000):
pass
Metadata
Release files for timeit-resource 0.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 | Provenance | Actions |
|---|---|---|---|---|
| timeit_resource-0.0.1.tar.gz | 6.5 kB | Without provenance | Details for timeit_resource-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| timeit_resource-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for timeit_resource-0.0.1-py3-none-any.whl |
Total release size: 13.7 kB
Release files / timeit_resource-0.0.1.tar.gz
| Download URL | timeit_resource-0.0.1.tar.gz |
|---|---|
| Size | 6.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
87a57b4622d0cc45e444917df01bfc3afb3705f73906967935907b118d239059
|
|
BLAKE2b-256 checksum How to use checksums |
60d18e60fc94e8a93b755b1d3e2faf46fc8963096eedceafd2464396115a9aa5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.0
|
Release files / timeit_resource-0.0.1-py3-none-any.whl
| Download URL | timeit_resource-0.0.1-py3-none-any.whl |
|---|---|
| Size | 7.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6973b67940b53be5e36c8fafd801dd9b3a621ed6dd471e218c9bada7f35acdb9
|
|
BLAKE2b-256 checksum How to use checksums |
5d43611ad706ad6d05b76975c121b2ba53f1c54b2a0aecbe5bea1a1657de88e1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.0
|
Security for timeit-resource 0.0.1
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.