code: def timeit(func):
      '''
      计算运行消耗时间
      @timeit
      def test():
          time.sleep(1)
      '''
  
      def wapper(*args, **kwargs):
          _start = time.time()
          retval = func(*args, **kwargs)
          _end = time.time()
          logger.info('function %s() used : %.6f s' % (func.__name__, _end - _start))
          return retval
  
      return wappef timeit(func):
      '''
      计算运行消耗时间
      @timeit
      def test():
          time.sleep(1)
      '''
  
      def wapper(*args, **kwargs):
          _start = time.time()
          retval = func(*args, **kwargs)
          _end = time.time()
          logger.info('function %s() used : %.6f s' % (func.__name__, _end - _start))
          return retval
  
      return wapper
docs: 计算运行消耗时间
      @timeit
      def test():
          time.sleep(1)