I have been trying to calculate the current download speed as the file is being downloaded (not average) using Python's requests module. Searched on google , but could not find a definite solution . What is the logic to calculate the download speed? Should I keep track of how many bytes have been downloaded per sec ? Any help is appreciated .
Asked
Active
Viewed 120 times
-1
-
2There isn’t an ‘instantaneous’ download speed, so you will have to average over a smaller period like a second, or a fraction of a second and then multiply that number to express it in e.g. bytes/second. Please edit a minimal complete verifiable example https://www.stackoverflow.com/help/mcve based on your current code into the question, and explain what it doesn’t do that you want it to do. – DisappointedByUnaccountableMod Aug 24 '19 at 20:23
1 Answers
0
If you are using ubuntu OS, then you can simply install speedtest-cli to check your internet speed. Type in terminal:
sudo apt-get install speedtest-cli
Then just type speedtest-cli in terminal

Shan Ali
- 564
- 4
- 12
-
The OP wants to know the speed of the current download, not that of their internet connection. – martineau Aug 24 '19 at 20:46