|
|
|
|
@ -157,11 +157,11 @@ func Ping(domain string, PS int) {
|
|
|
|
|
fmt.Println("Got signal:", s)
|
|
|
|
|
default:
|
|
|
|
|
if dur <= 30 {
|
|
|
|
|
fmt.Printf("%d bytes from %s (%s): icmp_seq=%d ttl=53 time=%.3f ms\n", len, raddr.String(), raddr.String(), icmp_seq, green(dur))
|
|
|
|
|
fmt.Printf("%d bytes from %s (%s): icmp_seq=%d ttl=53 time=%.3f %s\n", len, raddr.String(), raddr.String(), icmp_seq, dur, green("ms"))
|
|
|
|
|
} else if dur <= 500 {
|
|
|
|
|
fmt.Printf("%d bytes from %s (%s): icmp_seq=%d ttl=53 time=%.3f ms\n", len, raddr.String(), raddr.String(), icmp_seq, yellow(dur))
|
|
|
|
|
fmt.Printf("%d bytes from %s (%s): icmp_seq=%d ttl=53 time=%.3f %s\n", len, raddr.String(), raddr.String(), icmp_seq, dur, yellow("ms"))
|
|
|
|
|
} else {
|
|
|
|
|
fmt.Printf("%d bytes from %s (%s): icmp_seq=%d ttl=53 time=%.3f ms\n", len, raddr.String(), raddr.String(), icmp_seq, red(dur))
|
|
|
|
|
fmt.Printf("%d bytes from %s (%s): icmp_seq=%d ttl=53 time=%.3f %s\n", len, raddr.String(), raddr.String(), icmp_seq, dur, red("ms"))
|
|
|
|
|
//fmt.Printf("来自 %s 的回复: 大小 = %d byte 时间 = %.3fms\n", raddr.String(), len, dur)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|