mirror of
https://github.com/XIU2/CloudflareSpeedTest.git
synced 2026-03-06 14:45:56 +08:00
新增 HTTPing 延迟测速模式(beta); 新增 IP 机场三字码 colo 筛选功能(beta) (#282)
这两个功能目前仅为测试版,后续会大幅改动,以最终成品为准~
This commit is contained in:
14
utils/csv.go
14
utils/csv.go
@@ -6,7 +6,10 @@ import (
|
||||
"log"
|
||||
"net"
|
||||
"os"
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -21,6 +24,7 @@ var (
|
||||
InputMinDelay = minDelay
|
||||
Output = defaultOutput
|
||||
PrintNum = 10
|
||||
ColoAble sync.Map
|
||||
)
|
||||
|
||||
// 是否打印测试结果
|
||||
@@ -139,6 +143,16 @@ func (s DownloadSpeedSet) Swap(i, j int) {
|
||||
}
|
||||
|
||||
func (s DownloadSpeedSet) Print() {
|
||||
var colos []string
|
||||
ColoAble.Range(func(key, value interface{}) bool {
|
||||
colos = append(colos, key.(string))
|
||||
return true
|
||||
})
|
||||
if len(colos) != 0 {
|
||||
sort.Strings(colos)
|
||||
colostrings := strings.Join(colos, ",")
|
||||
fmt.Println("\n下次可以考虑机场三字码参数:" + colostrings + "\n")
|
||||
}
|
||||
if NoPrintResult() {
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user