Skip to main content

SimpleTimer

A repo containing an object that be wrapped to record time taken for operations within

To Use

  • Install requirements using pip install -r requirements.txt
  • Import from the timer.py file the Stopwatch object and initialise it, setting it to False if you do not wish to see a log of the time taken
  • Simply use a 'with' statement with the object and add all operation inside of the statement

Stopwatch Example

Code

from timer import Stopwatch
import time

timer = Stopwatch(True)

with timer:
    for x in range(10):
        time.sleep(1)
        print(x)

Output

0
1
2
3
4
5
6
7
8
9
[02/12/2022 04:03:30 PM] [INFO] Time taken to complete operations: 10.0755204s

StopwatchKafka Example

Code

from timer.timer import StopwatchKafka

import time

timer = StopwatchKafka(kafka_topic="numtest")


for x in range(5):
    with timer:
        time.sleep(2)

Output (from Kafka Consumer Side)

{'time_taken': 2.0093802999999997}
{'time_taken': 2.0095709000000004}
{'time_taken': 2.0142518000000003}
{'time_taken': 2.0143922000000005}
{'time_taken': 2.0023295999999995}

Metadata

Release files for simpletimer-kafka 0.1.9

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

Source distribution (sdist)

Source distribution for simpletimer-kafka 0.1.9
File Size Uploaded Provenance Actions
simpletimer-kafka-0.1.9.tar.gz 15.1 kB Without provenance Details for simpletimer-kafka-0.1.9.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for simpletimer-kafka 0.1.9
File Interpreter ABI Platform Actions
simpletimer_kafka-0.1.9-py3-none-any.whl Python 3 none any Details for simpletimer_kafka-0.1.9-py3-none-any.whl

Total release size: 30.4 kB

Release files / simpletimer-kafka-0.1.9.tar.gz

Download URL simpletimer-kafka-0.1.9.tar.gz
Size 15.1 kB
Tags Source
SHA-256 checksum
How to use checksums
5a187aee59b47485f43900c01938b8eee863bd3ae87f55daedbeaf160b753d3b
BLAKE2b-256 checksum
How to use checksums
a9ad7ad441e5bbbb9d8c43e5040170dbdc131ea91bf61a8ffab480dc88e384ed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.2.1 CPython/3.9.7 Linux/6.0.6-76060006-generic

Release files / simpletimer_kafka-0.1.9-py3-none-any.whl

Download URL simpletimer_kafka-0.1.9-py3-none-any.whl
Size 15.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d39beacc78352324bcc0b4fa9153d8900fe7d1c489d38cce24806aad6ddcf80e
BLAKE2b-256 checksum
How to use checksums
d7bf03ce1435a79b93497344bd981cae9d5d27f4cafbfa35444141e07443f5a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.2.1 CPython/3.9.7 Linux/6.0.6-76060006-generic

Security for simpletimer-kafka 0.1.9

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.

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