Ensuring time_fn is an instance of Time before using context manager