The Response
object provides an elapsed
attribute:
The amount of time elapsed between sending the request and the arrival of the response (as a timedelta)
Your code would then look like:
r = requests.get(test_cdn_url)
roundtrip = r.elapsed.total_seconds()