code: def timestamp_to_ms(groups):
      
      h, m, s, frac = map(int, groups)
      ms = frac * 10**(3 - len(groups[-1]))
      ms += s * 1000
      ms += m * 60000
      ms += h * 3600000
      return ms
docs: Convert groups from :data:`pysubs2.time.TIMESTAMP` match to milliseconds.
      
      Example:
          >>> timestamp_to_ms(TIMESTAMP.match("0:00:00.42").groups())
          420