code: def parse_interval(val):
      
      re_intv = re.compile(r"([\d\.]+)([a-zA-Z]+)")
      val = val.strip()
  
      total = 0.0
      for match in re_intv.findall(val):
          unit = match[1]
          count = float(match[0])
          if unit == 's':
              total += count
          elif unit == 'm':
              total += count * 60
          elif unit == 'ms':
              total += count / 1000
          elif unit == "h":
              total += count * 3600
          elif unit == 'd':
              total += count * 86400
          else:
              raise ValueError("unknown unit from interval string '%s'" % val)
      return total
docs: converts a string to float of seconds
          .5 = 500ms
          90 = 1m30s