Python, Python Programming, Programming, Coding, Artificial Intelligence.
function code. Let’s look at an example of how to use a decorator to add timing to a function. First, we write a sample function to add one second delay to code: import time def long_running_function(): time.sleep(1) long_running_function() # Output is nothing but the operation finishes after 1