def get_ms(delta):
    """Convert a datetime.timedelta into the corresponding milliseconds.

    >>> from datetime import timedelta
    >>> get_ms(timedelta(1, 1, 1, 1))
    86401001.001
    >>> get_ms(timedelta(days=1))
    86400000.0
    >>> get_ms(timedelta(seconds=15))
    15000.0
    >>> get_ms(timedelta(milliseconds=15, microseconds=222))
    15.222
    """
    return delta.days * 24 * 60 * 60 * 1000 + delta.seconds * 1000 + delta.microseconds / 1000