Darktrace Interview Question

Can you show us how to write a decorator function to time how long a function takes to run?