def parse_time(value: str) -> int:
    """
    Parses the string into a integer representing the number of milliseconds.
    """
    if value.endswith("ms"):
        return int(float(value.replace("ms", "")))
    return int(float(value.replace("s", "")) * 1000)