Skip to content

benchmark_timer#

Function Decorator#

How to use @benchmark_timer as function decorator:

Python
1
2
3
4
5
6
7
from timer import benchmark_timer

@benchmark_timer
def test_function():
    # Insert your code here

test_function()

Terminal output example:

Elapsed time: 12.34 seconds for thread TEST_FUNCTION