Skip to main content

Conveniently get a rough idea of how long things take.

Project description

magic-timer

pip install magic-timer

Conveniently get a rough idea of how long things take.

Use via decorator:

from magic_timer import MagicTimer, magic_timer
import time

@magic_timer
def some_slow_function():
    time.sleep(3)

some_slow_function()
> magic-timer: 'some_slow_function' - 0:00:00:03:000

Use via MagicTimer object:

def some_slow_function():
    time.sleep(2)

timer = MagicTimer()

some_slow_function()

print(timer)
> 0:00:00:02:000

Output is in: days:hours:minutes:seconds:milliseconds

See also this notebook.

This package is tiny. It uses time.time() to measure time. For greater precision & accuracy, you could use something like timeit.

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

magic-timer-0.0.7.tar.gz (2.2 kB view details)

Uploaded Source

Built Distribution

magic_timer-0.0.7-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file magic-timer-0.0.7.tar.gz.

File metadata

  • Download URL: magic-timer-0.0.7.tar.gz
  • Upload date:
  • Size: 2.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for magic-timer-0.0.7.tar.gz
Algorithm Hash digest
SHA256 a849ccf33bc1866db69769d28dcb51a68bd1262ca36831dd49ce189c2085b0a9
MD5 51d6ea26fd95ab3e22e01605a69950c6
BLAKE2b-256 e4bde6774501c26bdaf9f8a0192df548ad3db05d489d3a0acd080d5360ab3d7e

See more details on using hashes here.

File details

Details for the file magic_timer-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: magic_timer-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for magic_timer-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 84deb14724dda66541ae93747c875046d8a11e3787a8ce85a8701ad3b9882ffd
MD5 e1846808b619b09e4a784367ba3158ef
BLAKE2b-256 96e053f72b00e6158469e30dda330bf36d0be4187fd53cb1d80b5e86f150abcf

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