def toc(self, average=True):
    self.diff = (time.time() - self.start_time)
    self.total_time += self.diff
    self.calls += 1
    self.average_time = (self.total_time / self.calls)
    if average:
        return self.average_time
    else:
        return self.diff
def toc(self, average=True):
    self.diff = (time.time() - self.start_time)
    self.total_time += self.diff
    self.calls += 1
    self.average_time = (self.total_time / self.calls)
    if average:
        return self.average_time
    else:
        return self.diff