code: def timer(fun, *a, **k):
      
      @wraps(fun)
      def timer(*a, **k):
          start = arrow.now()
          ret = fun(*a, **k)
          end = arrow.now()
          print('timer:fun: %s\n start:%s,end:%s, took [%s]' % (
              str(fun), str(start), str(end), str(end - start)))
          return ret
      return timer
docs: define a timer for a rule function
      for log and statistic purposes