Gives human-readable output for basic timing benchmarks
Returns a string formatted in: "Y years, W weeks, D days, HH:MM:SSs"
(or ms, us, ns, ps, fs for very small times)
Automatically reduces fields which are larger than the time passed or
smaller than the requested precision.
Examples with ndigits=4:
format_seconds(0.00096685) -> "966.9us"
format_seconds(0.00387514) -> "3.875ms"
format_seconds(0.01553157) -> "15.53ms"
format_seconds(0.06225062) -> "62.25ms"
format_seconds(0.24950074) -> "0.2495s"
format_seconds(1.0 ) -> "1s"
format_seconds(4.008004 ) -> "4.008s"
format_seconds(16.0640960) -> "16.06s"
format_seconds(64.3849612) -> "1:04.4s"
format_seconds(258.055182) -> "4:18.1s"
format_seconds(1034.28620) -> "17:14s"
format_seconds(4145.42323) -> "1:09:05s"
format_seconds(16614.8729) -> "4:36:55s"
format_seconds(66592.4771) -> "18:29m"
format_seconds(266902.914) -> "3 days, 02:08m"
format_seconds(1069747.94) -> "1 week, 5 days, 9h"
format_seconds(4287554.06) -> "7 weeks, 0 days, 14h"
format_seconds(17184533.8) -> "28 weeks, 2 days"
format_seconds(68875680.3) -> "2 years, 9 weeks, 4 days"
format_seconds(276054002.) -> "8 years, 39 weeks, 2 days"
Metadata
Release files for human_time_formatter 1.0.0.6
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 | |
|---|---|---|---|---|
| human_time_formatter-1.0.0.6.tar.gz | 3.6 kB | Without provenance | Details |
Release files / human_time_formatter-1.0.0.6.tar.gz
| Download URL | human_time_formatter-1.0.0.6.tar.gz |
|---|---|
| Size | 3.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
703e57a716893be6552b2a5f69b0ba6fe375043da2a1b0c251fa486b2841a4b7
|
|
BLAKE2b-256 checksum How to use checksums |
4e7255fb3d18c87277c98cfbfc23146b597449c95d10848da0d5acbdbd460849
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for human_time_formatter 1.0.0.6
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.