def parse_time(time):
    """
    Convert to seconds.  Supports h, m, s.
    """
    try:
        return int(time)
    except:
        units, time = time[-1].lower(), int(time[:-1])
        return {'s': 1, 'm': 60, 'h': 60 * 60}[units] * time
