human
I am working on the file "2017-07-05.ipynb".
The first task is:
Now we're actuly going to do something with the func that is passed in. We're going to call it right in the middle of our new timer decorator. We do a little work before it is called -- we take a snapshot of the system clock with time() -- and a little more after -- another call to time(). This is the essence of a decorator.
Can you write Python program for it?
assistant
#Here is the Python program you requested.

def timer(func):
    def wrapper():
        t1 = time()
        func()
        t2 = time()
        print("{} duration is {}".format(func.__name__, t2 - t1))
    return wrapper

def slow_func():
    sleep(2)