def timedelta_milliseconds(delta):
    """
    Converts the given timedelta to milliseconds.

    :type delta: timedelta
    :rtype: float
    """
    return (delta.days * 86400000 + delta.seconds * 1000.0 + delta.
        microseconds / 1000.0)
