Skip to main content

Conveniently get a rough idea of how long things take.

Project description

magic-timer

pip install magic-timer

A simple 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(2.75)

some_slow_function()
> 'some_slow_function' - 2.8 seconds

Use via MagicTimer object:

def some_slow_function():
    time.sleep(90/1000)

timer = MagicTimer()

some_slow_function()

print(timer)
> 94 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.9.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

magic_timer-0.0.9-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: magic-timer-0.0.9.tar.gz
  • Upload date:
  • Size: 3.0 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.9.tar.gz
Algorithm Hash digest
SHA256 173d60637b3a90b087d025fb166ad664c3da1b659644dc683cbb537cef32b131
MD5 5b65f6ac7590620dba52ff57b92768f2
BLAKE2b-256 166f8bb96bfa16f4a0ad55c6dfd388ee29e5209f43030918c9500f6f38d43081

See more details on using hashes here.

File details

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

File metadata

  • Download URL: magic_timer-0.0.9-py3-none-any.whl
  • Upload date:
  • Size: 4.7 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.9-py3-none-any.whl
Algorithm Hash digest
SHA256 c0e4da9ed830d3b3a0f92844fec1a6cd10a1b26897665ed6d775ead69b32dea5
MD5 4eb1815a1731b1030ced53af45f54971
BLAKE2b-256 023a11c8e19454f57a4a6227d3068d6c8a87e6a76a871568afe699d52ff4b086

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