Skip to content

Commit 7f3a896

Browse files
committed
fix: 优化测速延迟显示
1 parent 8658483 commit 7f3a896

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

sp/sp.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ func NearbySpeedTest() {
215215
fmt.Print(formatString("Speedtest.net", 16))
216216
fmt.Print(formatString(fmt.Sprintf("%-8s", fmt.Sprintf("%.2f", NearbyServer.ULSpeed.Mbps())+" Mbps"), 16))
217217
fmt.Print(formatString(fmt.Sprintf("%-8s", fmt.Sprintf("%.2f", NearbyServer.DLSpeed.Mbps())+" Mbps"), 16))
218-
fmt.Print(formatString(fmt.Sprintf("%s", NearbyServer.Latency), 16))
218+
fmt.Print(formatString(NearbyServer.Latency.String(), 16))
219219
fmt.Print(formatString(PacketLoss, 16))
220220
fmt.Println()
221221
NearbyServer.Context.Reset()
@@ -309,7 +309,7 @@ func CustomSpeedTest(url, byWhat string, num int, language string) {
309309
}
310310
fmt.Print(formatString(fmt.Sprintf("%-8s", fmt.Sprintf("%.2f", server.ULSpeed.Mbps())+" Mbps"), 16))
311311
fmt.Print(formatString(fmt.Sprintf("%-8s", fmt.Sprintf("%.2f", server.DLSpeed.Mbps())+" Mbps"), 16))
312-
fmt.Print(formatString(fmt.Sprintf("%s", server.Latency), 16))
312+
fmt.Print(formatString(server.Latency.String(), 16))
313313
fmt.Print(formatString(PacketLoss, 16))
314314
fmt.Println()
315315
}

0 commit comments

Comments
 (0)