diff --git a/README.md b/README.md index 2171c07..88842de 100644 --- a/README.md +++ b/README.md @@ -111,35 +111,35 @@ https://github.com/XIU2/CloudflareSpeedTest 参数: -n 200 - 测速线程数量;越多测速越快,性能弱的设备 (如路由器) 请适当调低;(默认 200 最多 1000 ) + 测速线程数量;越多测速越快,性能弱的设备 (如路由器) 请勿太高;(默认 200 最多 1000) -t 4 - 延迟测速次数;单个 IP 延迟测速次数,为 1 时将过滤丢包的IP,TCP协议;(默认 4 ) + 延迟测速次数;单个 IP 延迟测速次数,为 1 时将过滤丢包的IP,TCP协议;(默认 4) -tp 443 - 延迟测速端口;延迟测速 TCP 协议的端口;(默认 443 ) + 延迟测速端口;延迟测速 TCP 协议的端口;(默认 443) -dn 10 - 下载测速数量;延迟测速并排序后,从最低延迟起下载测速的数量;(默认 10 ) + 下载测速数量;延迟测速并排序后,从最低延迟起下载测速的数量;(默认 10) -dt 10 - 下载测速时间;单个 IP 下载测速最长时间,单位:秒;(默认 10 ) + 下载测速时间;单个 IP 下载测速最长时间,单位:秒;(默认 10) -url https://cf.xiu2.xyz/Github/CloudflareSpeedTest.png 下载测速地址;用来下载测速的 Cloudflare CDN 文件地址,如地址含有空格请加上引号; -tl 200 平均延迟上限;只输出低于指定平均延迟的 IP,可与其他上限/下限搭配;(默认 9999 ms) -tll 40 - 平均延迟下限;只输出高于指定平均延迟的 IP,可与其他上限/下限搭配,过滤被假蔷的 IP;(默认 0 ms) + 平均延迟下限;只输出高于指定平均延迟的 IP,可与其他上限/下限搭配、过滤被假蔷的 IP;(默认 0 ms) -sl 5 下载速度下限;只输出高于指定下载速度的 IP,凑够指定数量 [-dn] 才会停止测速;(默认 0.00 MB/s) -p 10 - 显示结果数量;测速后直接显示指定数量的结果,为 0 时不显示结果直接退出;(默认 10 ) + 显示结果数量;测速后直接显示指定数量的结果,为 0 时不显示结果直接退出;(默认 10) -f ip.txt - IP段数据文件;如路径含有空格请加上引号;支持其他 CDN IP段;(默认 ip.txt ) + IP段数据文件;如路径含有空格请加上引号;支持其他 CDN IP段;(默认 ip.txt) -o result.csv - 写入结果文件;如路径含有空格请加上引号;值为空时不写入文件 [-o ""];(默认 result.csv ) + 写入结果文件;如路径含有空格请加上引号;值为空时不写入文件 [-o ""];(默认 result.csv) -dd - 禁用下载测速;禁用后测速结果会按延迟排序 (默认按下载速度排序);(默认 启用 ) + 禁用下载测速;禁用后测速结果会按延迟排序 (默认按下载速度排序);(默认 启用) -ipv6 - IPv6测速模式;确保 IP 段数据文件内只包含 IPv6 IP段,软件不支持同时测速 IPv4+IPv6;(默认 IPv4 ) + IPv6测速模式;确保 IP 段数据文件内只包含 IPv6 IP段,软件不支持同时测速 IPv4+IPv6;(默认 IPv4) -allip - 测速全部的IP;对 IP 段中的每个 IP (仅支持 IPv4) 进行测速;(默认 每个 IP 段随机测速一个 IP ) + 测速全部的IP;对 IP 段中的每个 IP (仅支持 IPv4) 进行测速;(默认 每个 IP 段随机测速一个 IP) -v 打印程序版本+检查版本更新 -h diff --git a/main.go b/main.go index 4ea48df..fb3ff4a 100644 --- a/main.go +++ b/main.go @@ -40,7 +40,7 @@ https://github.com/XIU2/CloudflareSpeedTest -tl 200 平均延迟上限;只输出低于指定平均延迟的 IP,可与其他上限/下限搭配;(默认 9999 ms) -tll 40 - 平均延迟下限;只输出高于指定平均延迟的 IP,可与其他上限/下限搭配,过滤被假蔷的 IP;(默认 0 ms) + 平均延迟下限;只输出高于指定平均延迟的 IP,可与其他上限/下限搭配、过滤被假蔷的 IP;(默认 0 ms) -sl 5 下载速度下限;只输出高于指定下载速度的 IP,凑够指定数量 [-dn] 才会停止测速;(默认 0.00 MB/s) -p 10 @@ -81,7 +81,7 @@ https://github.com/XIU2/CloudflareSpeedTest flag.Parse() if task.MinSpeed > 0 && time.Duration(maxDelay)*time.Millisecond == utils.InputMaxDelay { - fmt.Println("[警告] '-sl' 参数建议和 '-tl' 参数一起使用") + fmt.Println("[小提示] 在使用 [-sl] 参数时,建议搭配 [-tl] 参数,以避免因凑不够 [-dn] 数量而一直测速...") } utils.InputMaxDelay = time.Duration(maxDelay) * time.Millisecond utils.InputMinDelay = time.Duration(minDelay) * time.Millisecond @@ -92,7 +92,7 @@ https://github.com/XIU2/CloudflareSpeedTest fmt.Println("检查版本更新中...") checkUpdate() if versionNew != "" { - fmt.Println("发现新版本 [" + versionNew + "]!请前往 [https://github.com/XIU2/CloudflareSpeedTest] 更新!") + fmt.Printf("*** 发现新版本 [%s]!请前往 [https://github.com/XIU2/CloudflareSpeedTest] 更新! ***", versionNew) } else { fmt.Println("当前为最新版本 [" + version + "]!") } @@ -103,7 +103,7 @@ https://github.com/XIU2/CloudflareSpeedTest func main() { go checkUpdate() // 检查版本更新 - fmt.Printf("# XIU2/CloudflareSpeedTest %s \n", version) + fmt.Printf("# XIU2/CloudflareSpeedTest %s \n\n", version) // 开始延迟测速 pingData := task.NewPing().Run().FilterDelay() @@ -123,7 +123,7 @@ func endPrint() { return } if runtime.GOOS == "windows" { // 如果是 Windows 系统,则需要按下 回车键 或 Ctrl+C 退出(避免通过双击运行时,测速完毕后直接关闭) - fmt.Println("\n按下 回车键 或 Ctrl+C 退出。") + fmt.Printf("\n按下 回车键 或 Ctrl+C 退出。") var pause int fmt.Scanln(&pause) } diff --git a/task/tcping.go b/task/tcping.go index fc5f9de..08a64df 100644 --- a/task/tcping.go +++ b/task/tcping.go @@ -66,7 +66,7 @@ func (p *Ping) Run() utils.PingDelaySet { if IPv6 { // IPv6 模式判断 ipVersion = "IPv6" } - fmt.Printf("开始延迟测速(模式:TCP %s,端口:%d,平均延迟上限:%vms,平均延迟下限:%vms)\n", ipVersion, TCPPort, utils.InputMaxDelay.Milliseconds(), utils.InputMinDelay.Milliseconds()) + fmt.Printf("开始延迟测速(模式:TCP %s,端口:%d,平均延迟上限:%v ms,平均延迟下限:%v ms)\n", ipVersion, TCPPort, utils.InputMaxDelay.Milliseconds(), utils.InputMinDelay.Milliseconds()) for _, ip := range p.ips { p.wg.Add(1) p.control <- false diff --git a/utils/csv.go b/utils/csv.go index 42a8f8d..9b7756b 100644 --- a/utils/csv.go +++ b/utils/csv.go @@ -161,6 +161,6 @@ func (s DownloadSpeedSet) Print(ipv6 bool) { fmt.Printf(dataFormat, dateString[i][0], dateString[i][1], dateString[i][2], dateString[i][3], dateString[i][4], dateString[i][5]) } if !noOutput() { - fmt.Printf("\n完整测速结果已写入 %v 文件,请使用记事本/表格软件查看。\n", Output) + fmt.Printf("\n完整测速结果已写入 %v 文件,可使用记事本/表格软件查看。", Output) } }