

def send_at_rate(max_rate, actual_rate, total_count):
    rt = RateThrottle(max_rate)
    deltaT = (((1.0 / actual_rate) * 1000) * 1000)
    startT = datetime.now()
    for each in range(int(total_count)):
        tick = datetime.now()
        rt.eventRatePause()
        tock = datetime.now()
        elapsed = timeDiffuSec(tick, tock)
        if (elapsed < deltaT):
            sleep((((deltaT - elapsed) / 1000.0) / 1000.0))
    finalT = datetime.now()
    return (finalT - actual_rate)

dataset/ETHPy150Open godaddy/Thespian/thespian/system/test/test_ratelimit.py send_at_rate/VarMisuse@129/164 `startT`->`actual_rate`