Skip to main content

tictactoc

Project description

tictactoc

A simple library to be able to control the time that certain parts of the code take

Installation and use

To install this module use:

pip install tictactoc

Run tests to validate:

tictactoc-tests

Usage

Basic use, start and end.

from tictactoc import tictactoc

tictactoc.tic() # Start
print(tictactoc.toc()) # Finish

Using tac in loops. We can do a tac in each iteration. When we finnish the loop, we do a toc skipping this time.

from time import sleep
from tictactoc import tictactoc

tictactoc.tic("my loop")

my_loop=[1,2]

for element in my_loop:
    sleep(0.1)
    tictactoc.tac("my loop")

result = tictactoc.toc("my loop", skip_toc=True)

print(f"total: {result["total"]}, each iteration: {', '.join(map(str,result["steps"]))}")

Credits

Developed and maintained by felipem775. Contributions are welcomed.

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

tictactoc-0.2.1.tar.gz (2.5 kB view details)

Uploaded Source

Built Distribution

tictactoc-0.2.1-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file tictactoc-0.2.1.tar.gz.

File metadata

  • Download URL: tictactoc-0.2.1.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for tictactoc-0.2.1.tar.gz
Algorithm Hash digest
SHA256 75c83ea86884f846b6afffdbd7dd36beded88935e8b125fe72a7d9966368ac51
MD5 88d5c07b140a1b1406be76e0956a6dd6
BLAKE2b-256 a993a4edcb7f3cd75fb2baed0070bec2d44fe269c81e887415f27964817e45a6

See more details on using hashes here.

File details

Details for the file tictactoc-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: tictactoc-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 3.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for tictactoc-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 61b7320110e78cd423edfdece5893d1a8857d1ffa2276afafb314ec7a871a3e8
MD5 f5c9e3f5585c32bf7e98a12c6f185970
BLAKE2b-256 3c07ea3acbbb0f7ca5b724b27177c3f28579a87870c4779c87ad540f45ca936f

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