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

What I have tried:

I have tried wininet, winsock2 but no result
Updated 15-Sep-21 20:01pm
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 ...
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.

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