code: def parse_time(t):
      
      if isinstance(t, (str, unicode)):
          b = re_time.match(t)
          if b:
              v, unit = int(b.group(1)), b.group(2)
              if unit == 's':
                  return v*1000
              elif unit == 'm':
                  return v*60*1000
              elif unit == 'h':
                  return v*60*60*1000
              else:
                  return v
          else:
              raise TimeFormatError(t)
      elif isinstance(t, (int, long)):
          return t
      else:
          raise TimeFormatError(t)
docs: Parse string time format to microsecond