测网速

出处:https://stackoverflow.com/questions/20190456/determine-available-upload-download-bandwidth

There's no way to determine the absolute network capacity between two points on a regular network. The reason is that the traffic can be rerouted in between, other data streams appear or disappear or links can be severed.

What you can do is figure out what is the available bandwidth right now. One way to do it is to upload/download a chunk of data (say 1MB) as fast as possible (no artificial caps), and measure how long it takes. From there you can figure out what bandwidth is available now and go from there.

You could periodically measure the bandwidth again to make sure you're not too way off.

原文地址:https://www.cnblogs.com/liujx2019/p/10309779.html