Beispiel #1
0
    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 = []
Beispiel #2
0
    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 = []
Beispiel #3
0
    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()
Beispiel #4
0
    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()