created context manager to print time elapsed