code: def wrap_function(self, func):
          
          def f(*args, **kwds):
              # Start time
              timestamps = [_get_memory(os.getpid(), timestamps=True)]
              self.functions[func].append(timestamps)
              try:
                  result = func(*args, **kwds)
              finally:
                  # end time
                  timestamps.append(_get_memory(os.getpid(), timestamps=True))
              return result
          return f
docs: Wrap a function to timestamp it.