Skip to main content

Simple profiling decorator

Project description

PyPI version There's even a Travis badge!

A simple profiling decorator:

In [1]: from profiled import profiled, Profiler

In [2]: @profiled
   ...: def get_answer():
   ...:     return 42
   ...:

In [3]: profiler = Profiler()

In [4]: with profiler.as_default():
   ...:     for i in range(100000): get_answer()
   ...:

In [5]: profiler.compute_stats()
Out[5]:
{'get_answer': {'avg': 2.2763967514038087e-07,
  'max': 0.00016736984252929688,
  'min': 0.0,
  'num': 100000,
  'std': 6.953436521202228e-07,
  'tot': 0.022763967514038086}}

That’s about it.

Install with pip install profiled.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

profiled-0.1.0-py2.py3-none-any.whl (3.1 kB view details)

Uploaded Python 2Python 3

File details

Details for the file profiled-0.1.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for profiled-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 acbe41420a749a869a91055691aad03eb43b02b5a22a49e5e98423f99c132419
MD5 0d84ece0748f9a0ea87f8c050bdc858a
BLAKE2b-256 21f7f88bb6111bde804455576d11c102700d55708934efd276d16c9b73b3db9b

See more details on using hashes here.

Supported by

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