Agreed. A good algorithm might be to divide up time into discrete seconds (
Time::HiRes can override
time to provide you with hi-resolution timekeeping), like
$time_left = $start_time + 1 - time(), calculate how many more requests you have to do in the remaining fraction of a second, and divide the time into slices, sleeping an appropriate amount of time so that the next slice occurs on time. That would allow your script to adapt to requests that vary in duration (due to network conditions or loading, etc.).