def __init__(self, key): # Name of the current function self.key = key self.parent = None # Time of creation self._start_time = time.time() # Time at the end. self._end_time = None if setting(key='memory_profile', expected_type=bool): # memory at creation self._start_memory = get_free_memory() # memory at termination self._end_memory = None # Children self.children = []
def __init__(self, key): # Name of the current function self.key = key self.parent = None # Time of creation self._start_time = time.time() # Time at the end. self._end_time = None if setting(key='memory_profile', expected_type=bool): # memory at creation self._start_memory = get_free_memory() # memory at termination self._end_memory = None # Children self.children = []
def ended(self): """We call this method when the function is finished.""" self._end_time = time.time() if setting(key='memory_profile', expected_type=bool): self._end_memory = get_free_memory()
def ended(self): """We call this method when the function is finished.""" self._end_time = time.time() if setting(key='memory_profile', expected_type=bool): self._end_memory = get_free_memory()