由于是异步的开始时间和结束时间的差并不是执行时间。请问如果取?
start_time = func.millisecond()
conn = httplib.HTTPConnection(self.host,timeout=5)
conn.putrequest("GET", "/")
conn.putheader("Host", self.domain)
conn.endheaders()
res = conn.getresponse()
end_time = func.millisecond()
use_time = str(end_time - start_time)
start_time = func.millisecond()
conn = httplib.HTTPConnection(self.host,timeout=5)
conn.putrequest("GET", "/")
conn.putheader("Host", self.domain)
conn.endheaders()
res = conn.getresponse()
end_time = func.millisecond()
use_time = str(end_time - start_time)