'Calculate the time to sleep on a throttle.
Args:
total: The total amount transferred.
limit: The amount per second that is allowed to be sent.
duration: The amount of time taken to send the total.
Returns:
A float for the amount of time to sleep.'

def _SleepTime(self, total, limit, duration):

    if (not limit):
        return 0.0
    return max(0.0, ((total / limit) - duration))
