Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I don't find any library to measure network speed


What I have tried:

I have tried wininet, winsock2 but no result
Posted
Updated 7-Jun-22 20:23pm
Comments
jeron1 15-Sep-21 14:08pm    
Are you looking for the current link speed (e.g. 100Mbps vs 1000Mbps) or actual current throughput type of data?

There isn't really an library to do it, because it requires two end points - your software on the "consumer PC", and software at the other end to supply and receive the data in a consistent fashion.
And "normal" websites don't do that - they are all bandwidth limited to a greater or lesser extent by the number of users and the data they are dealing with. Add in that your internet speed is affected by the worst node in the current "hop" and it all gets a bit silly.
That's why these "speed test sites" take a long time to do anything: they are up-loading and downloading a large amount of data and averaging out the "internet speed" from that.

You want to write one? You need to write it at the server end first (which won't be C or C++) and then probably use a browser to display the results and provide the dummy data for transfer. That won't be C++ either ...
 
Share this answer
 
A simple solution is to download some file and measure the time. A simple example file download, but it is depending on your tools and frameworks.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900