def percentage_of_timedelta(total, duration):
    """Return percentage duration timedelta is of total timedelta."""
    proportion = duration.total_seconds() / total.total_seconds()
    return '{:.2%}'.format(proportion)