def _wrap(self, *args, **kwargs): st = time() try: func(self, *args, **kwargs) finally: et = time() print '[SESSION] %s elapsed in %s' % (self.client_address or id(self), human_elapsed_time(et - st))
def _wrap(*args, **kwargs): st = time() try: func(*args, **kwargs) finally: total = time() - st if total >= DEBUG_TIME_WARN_THRESHOLD: print '[DEBUG-TIME] %s(): %s' % (func.__name__, human_elapsed_time(total))