pz@asus:~/snippets/urllib-timeout $ python3 urllib_check.py
Test server send bytes at one moment, with timeout 1.
b'1234567890'
Duration: 0.0029508500010706484
Test server send 1 byte per 0.5 sec, with timeout 1.
b'1234567890'
Duration: 13.017826942999818
Test server send 1 bytes per 2 sec for total 10 bytes (56 sec long), with timeout 10.
b'1234567890'
Duration: 52.54494177000015
pz@asus:~/snippets/urllib-timeout $ python3.7 urllib_check.py
Test server send bytes at one moment, with timeout 1.
b'1234567890'
Duration: 0.005291239001962822
Test server send 1 byte per 0.5 sec, with timeout 1.
b'1234567890'
Duration: 13.016211187998124
Test server send 1 bytes per 2 sec for total 10 bytes (56 sec long), with timeout 10.
b'1234567890'
Duration: 52.54022990700469
pz@asus:~/snippets/urllib-timeout $ python3.8 urllib_check.py
Test server send bytes at one moment, with timeout 1.
b'1234567890'
Duration: 0.004608458002621774
Test server send 1 byte per 0.5 sec, with timeout 1.
b'1234567890'
Duration: 13.018239862001792
Test server send 1 bytes per 2 sec for total 10 bytes (56 sec long), with timeout 10.
b'1234567890'
Duration: 52.542847764001635