Skip to main content

A simple package to calculate the execution time of certain lines of code

Project description

Install

pip install etime

Usage:-

Execution Time

from et import ET

execution_time = ET("info")
"""
    YOUR CODE HERE
"""
execution_time.stop()

Output:

 self  | The execution time = 0:00:00.000158S  | 156000 NS

Example

from et import ET

executiontime = ET("Calculate radians")

import math
input1 = 1234567
y = math.radians(input1)
print(f'\n The input = {input1}, output = {y}')

executiontime.stop()

Output

The input = 1234567, output = 21547.258986468834
Calculate radians  | The execution time = 0:00:00.000102S  | 105000 NS

ETM [Execution Time Manager]

from et import ETM

with ETM() as etm:
    """
    YOUR CODE HERE
    """

Output:

[Started]: 2021-01-19 17:36:39.878058
[End]: 2021-01-19 17:36:39.878538 Sec
[Elapsed time]:  0:00:00.000466 Sec

example

from et import ETM

with ETM() as em:
    import math
    input1 = 1234567
    y = math.radians(input1)
    print(f'\n The input = {input1}, output = {y}')

Output

The input = 1234567, output = 21547.258986468834

[Started]: 2021-01-19 17:36:39.878058
[End]: 2021-01-19 17:36:39.878538 Sec
[Elapsed time]:  0:00:00.000466 Sec

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

etime-0.4.tar.gz (2.7 kB view hashes)

Uploaded Source

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