<div dir="ltr"><div class="gmail_extra">Hi Sergey,<br><br><br></div><div class="gmail_extra">Several points:<br><br></div><div class="gmail_extra">1. Making a new factory for each *client* connection isn't unusual -- just for servers.<br>

</div><div class="gmail_extra">2. The API you probably want to use is twisted.web.client.Agent.<br></div><div class="gmail_extra">3. You could do something like this (I wrote no tests for this!)<br><br>def timeURL(agent, url):<br>

    return agent.get(url).addCallback(_responseReceived, time.time(), url)<br><br>def _responseReceived(response, startTime, url):<br>    elapsed = time.time() - startTime<br>    print "Elapsed for {}: {}s".format(url, elapsed)<br>

    # Note: response received gets called before the entire body is received<br><br></div><div class="gmail_extra">... or you could wrap that startTime and URL state in an object, of course :-)<br><br></div><div class="gmail_extra">

hope to help<br>lvh<br></div></div>