Skip to main content

Time marking package in code.

Project description

Description

This module is designed for setting time stamps in code, convenient to use in cycles.

Installing

pip install tmark

or

pip install git+https://github.com/OnisOris/tmark

Example

import tmark as tm
import time

tracker = tm.LatencyTracker()

# Simulation of a cycle with multiple tags in one iteration
for i in range(12):
    tracker.start("operation_1")
    time.sleep(0.1 + i * 0.02)  # Simulation of first operation
    tracker.stop("operation_1")

    tracker.start("operation_2")
    time.sleep(0.2 + i * 0.03)  # Simulation of the second operation
    tracker.stop("operation_2")

    tracker.start("operation_3")
    time.sleep(0.15 + i * 0.01)  # Simulation of the third operation
    tracker.stop("operation_3")

# Graph from object data
tracker.plot(statistic=True)

# Save to csv file
tracker.save_to_csv()

# Reading from csv file and plotting
tracker.plot_from_csv()

Graphic

Possible errors

/.../.venv/lib/python3.10/site-packages/tmark/latency_tracker.py:88: UserWarning: FigureCanvasAgg is non-interactive, and thus cannot be shown plt.show()

Solution:

pip install PyQt6

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tmark-0.0.3.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

tmark-0.0.3-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file tmark-0.0.3.tar.gz.

File metadata

  • Download URL: tmark-0.0.3.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.1

File hashes

Hashes for tmark-0.0.3.tar.gz
Algorithm Hash digest
SHA256 8ce0e026443918f30bf54af214e7edd6250b3b51bbd6639ac50300e97b50e1f1
MD5 40a071a6ab0e0dc6b21087c1b7995c28
BLAKE2b-256 204e6226ede8cc958670108b528adf3822f2cccfa40d798c63a99b25e51b5b3c

See more details on using hashes here.

File details

Details for the file tmark-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: tmark-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 10.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.1

File hashes

Hashes for tmark-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 341289162eb8dce3af5889e64a819629f510710502fba8573d98ff7889c7f0e4
MD5 6a5cf61b3210b3d08fc16442a2a48bab
BLAKE2b-256 0231f1066d6b4d78c1637759e4a817403dbc6ee532e80386c30a07f8e6ebe508

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page