用Java进行网速测试命令格式:ping ip地址 -l 字节数注:上面的命令中 l 是字母l,不是数字1网速等于≈(发送的字节数/返回的时间[毫秒])K字节以上计算的结果速为字节(byte),不是我们通常说的位(bps)如:C:\Documents and Settings\Administrator>ping 202.101.224.68 -l 1000Pinging 202.101.224.68 with 1000 bytes of data:Reply from 202.101.224.68: bytes=1000 time=38ms TTL=251Reply from 202.101.224.68: bytes=1000 time=38ms TTL=251Reply from 202.101.224.68: bytes=1000 time=38ms TTL=251Reply from 202.101.224.68: bytes=1000 time=38ms TTL=251Ping statistics for 202.101.224.68: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: Minimum = 38ms, Maximum = 38ms, Average = 38ms根据上述发送及返回的信息可以简单得出到地址202.101.224.68的网速为:网速等于≈(发送的字节数/返回的时间[毫秒])K字节 ≈1000/38K字节 ≈26.32K字节附:ping命令帮助说明-l size Send buffer size -w timeout Timeout in milliseconds to wait for each reply.-n count Number of echo requests to send.-----------------------------------------原文:http://www.cnblogs.com/zhuzhuxuan/p/5191780.html