def METHOD_NAME (key):
    """ ContextManager to help measuring time. 
        with timer('myname') as t:
            do_code_that_is_timed
    """
    class TimerContextManager (object):
        def __init__ (self, key):
            self._key = key
        def __enter__ (self):
            start (key)
            return None
        def __exit__ (self, exc_type, exc_value, traceback):
            stop (key)
            return False
    return TimerContextManager (key)