Skip to main content

Lightweight profiling tool to detect performance BottleNecks in Python code.

Project description

Hence the name: bn - BottleNeck. And you know keys B and N are very comfortable to type quickly in a row.



for item in generator:

    bn('step 1')
    # code of step 1

    bn('step 2')
    # code of step 2


bn() # Stop tracking.

if > 1.0:


22.2632    TOTAL
20.6403    step 2
 1.6209    step 1
 0.0020    iteration


pip install bn
from bn import bn

# OR:

from bn import Bn
def action():
    bn = Bn()


bn.total_key = 'TOTAL'
bn.format = '{seconds:>10.4f}    {key}'

See also:

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

bn-0.1.4.tar.gz (1.9 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page