elapsed_time¶
Attributes¶
Functions¶
|
|
|
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
- 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: {}¶