Skip to main content

Tool for timing the execution of Python functions

Project description

Tool for timing the execution of Python functions.

Installation

Install with pip:

pip install clockit

Usage

Run as follows:

$ python
>>> from clockit import clockit
>>> def f(x, y=1):
...     return x, y
...
>>> clocked = clockit(f, 1, y=2)
>>> clocked.result
(1, 2)
>>> clocked.time
0.0005593200330622494

clockit uses the timeit module which accepts objects that are callable without arguments.

Distribution

Install requirements:

$ pip install -r requirements.txt

Bump the package version, then build a source distribution and a wheel:

$ python setup.py sdist bdist_wheel

Register the project with the PyPI test server:

$ python setup.py register -r test

Use twine to safely upload previously built distributions to the PyPI test server:

$ twine upload -r test dist/clockit-<version>*

If all is well, register the project with PyPI:

$ python setup.py register

Finally, use twine to safely upload distributions to PyPI:

$ twine upload dist/clockit-<version>*

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

clockit-0.2.1.tar.gz (2.4 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: clockit-0.2.1.tar.gz
  • Upload date:
  • Size: 2.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for clockit-0.2.1.tar.gz
Algorithm Hash digest
SHA256 920ed30cfee1a022aa4e2d403b0a574fa72da2fdd8a90a94d6d75767fe3ca749
MD5 eddafc5befb4f1a076e40fa9c5144b34
BLAKE2b-256 8f2cc7c49961a85c614f672c57f89a8c8c730ff94920635740cf2d3297cb338d

See more details on using hashes here.

Supported by

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