Skip to main content

A simple but robust package to time any function

Reason this release was yanked:

duplicate version

Project description

Package Description

timeN is a simple package that contains a customizable @timen decorator which times how long it takes (in milliseconds) for the decorated function to run n times

Usage

The timen decorator is quite simple to use. it can be imported by simply importing the timeN package with

import timeN

From there, the timeN decorator can be used like any other decorator, with the exception that you must end the decorator in parentheses since it takes optional parameters

@timeN()
def foo():
    print("Hello World")

Output:

Hello World
...
Hello World
foo took 2.0 milliseconds to run 10 times

The 2 optional parameters are: n (number of times to run the function) and round_to (number decimal places to round the final result to).

@timeN(100, 5)
def foo():
    print("Hello World")

Output:

Hello World
...
Hello World
foo took 11.99365 milliseconds to run 100 times

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

timeN-1.2b0.tar.gz (3.8 kB view hashes)

Uploaded Source

Built Distribution

timeN-1.2b0-py3-none-any.whl (3.4 kB view hashes)

Uploaded Python 3

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