Does PycURL or any other python pakcage provides information about :
- lookup
- connection time
I would like to get the same information as this cURL command does (without calling the command using subprocess):
Command
curl -s -w '\nLookup time:\t%{time_namelookup}\nConnect time:\t%{time_connect}\nPreXfer time:\t%{time_pretransfer}\nStartXfer time:\t%{time_starttransfer}\n\nTotal time:\t%{time_total}\n' -o /dev/null http://stackoverflow.com/
Output:
Lookup time: 0.029
Connect time: 0.144
PreXfer time: 0.144
StartXfer time: 0.263
Total time: 0.803
Yes, PyCurl provides the information. You can derive the information using
pycurl
. It can give a lot of details, not just the ones you mentioned.Here's a sample code that you can use to derive the same information:
It gives the following results:
I found a GitHub link that mentions some of the other flags as well which can be used in your code. Here are the flags for a quick view: