use color red adjust 50ms timeout

master
sre 4 years ago
parent d27701a025
commit 491b79c179

@ -175,7 +175,7 @@ func Ping(domain string, PS int) {
func foot(address string, icmp_seq int, dropPack, min_lan, avg_lan, max_lan float64, ret_list []float64) {
red := color.New(color.FgRed).SprintFunc()
fmt.Printf("\n--- %s ping statistics ---\n", address)
fmt.Printf("%d packets transmitted, %f lost, %.2f%% packet loss, time 1000ms\n", icmp_seq, red(dropPack), dropPack/float64(icmp_seq)*100)
fmt.Printf("%d packets transmitted, %f %s, %.2f%% packet loss, time 1000ms\n", icmp_seq, dropPack, red("lost"), dropPack/float64(icmp_seq)*100)
if len(ret_list) == 0 {
avg_lan = 3000.0
} else {

Loading…
Cancel
Save