5. Timeit Decorator¶
Decorate your own function with @timeit decorator to monitoring execution time
Example:
1 2 3 4 5 6 7 8 9 10 11 | from decoratorutilities import timeit
import time
@timeit
def hello():
time.sleep(0.1)
if __name__ == "__main__":
hello() # print "Execution time: 100.75 ms"
|