Пример #1
0
 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))
Пример #2
0
 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))