elapsed_time

Attributes

d

Functions

timer([name])

elapsed_time([name])

Two ways to use elapsed_time():

Module Contents

elapsed_time.timer(name='timer')
elapsed_time.elapsed_time(name='elapsed_time')

Two ways to use elapsed_time(): 1. As a decorator to time the execution of an entire function:

@elapsed_time(“my_slow_function”) def my_slow_function(n=10_000_000):

pass

  1. As a context manager to time the execution of a block of code inside a function:
    with elapsed_time(“my_slow_block_of_code”):

    pass

.

elapsed_time.d: {}