Python Programming - Decorators - Discussion

Discussion Forum : Decorators - General Questions (Q.No. 6)
6.
Which decorator can be used to measure the execution time of a Python function?
@functools.lru_cache
@functools.singledispatch
@functools.wraps
@functools.timer
Answer: Option
Explanation:
There is no built-in @functools.timer decorator in Python, but a custom timer decorator can be created using external libraries or by measuring time manually.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.