smalltime
What is it?
smalltime is a quick and dirty library for timing Python function, sections of code and arbitrary programs on the command line.
Requirements
smalltime requires Python >= 3.6.2.
See pyproject.toml for dependencies and dev dependencies.
Installation
Via poetry:
poetry add smalltime
Via pip:
pip install smalltime
Basic Usage
In Python Code
In-Line
import smalltime
timer = smalltime.Timer(name="hello world timer")
timer.start()
print("Hello, ", end="")
print("World!")
timer.stop()
Via Decorator
import smalltime
import subprocess
@smalltime.timed(name="thing_timer")
def thing_you_want_to_time():
subprocess.call(["python", "-c", "\"import this\""])
thing_you_want_to_time()
From the Command Line
N.B.: Assumes installation via Poetry and an active Poetry shell.
# Usage: st <program> [args]
st sleep 10
Starting counter (BNM8rBqP)
Counter stopped (BNM8rBqP): 10007777130ns elapsed
Can I use this in my project?
Yes, please do! The code is all open source and BSD-3-Clause licensed.
Metadata
Release files for smalltime 0.0.7
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 |
|---|---|---|---|---|
| smalltime-0.0.7.tar.gz | 4.5 kB | Without provenance | Details for smalltime-0.0.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| smalltime-0.0.7-py3-none-any.whl | Python 3 | none | any | Details for smalltime-0.0.7-py3-none-any.whl |
Total release size: 9.4 kB
Release files / smalltime-0.0.7.tar.gz
| Download URL | smalltime-0.0.7.tar.gz |
|---|---|
| Size | 4.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
248f39d524f9cb8b13308b4683dcc181e33ec205936fc9f9669fb6a26178b360
|
|
BLAKE2b-256 checksum How to use checksums |
dd5f41952088a1d9a02eb696be71a256e947cd864207dd2f6a7d944552135d29
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.11 CPython/3.8.2 Linux/5.8.0-1042-azure
|
Release files / smalltime-0.0.7-py3-none-any.whl
| Download URL | smalltime-0.0.7-py3-none-any.whl |
|---|---|
| Size | 4.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
87642c0f69b8fc44ec38808172da5006965b3a351dc4abe501f62feddc50ecf8
|
|
BLAKE2b-256 checksum How to use checksums |
56114510c8ad0b520444b8e100b4419c764794770eca21f1a1c6c4c25835a6f2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.11 CPython/3.8.2 Linux/5.8.0-1042-azure
|
Security for smalltime 0.0.7
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.