summaryrefslogtreecommitdiff
path: root/ping.go
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2018-04-18 16:28:37 -0400
committerLuke Shumaker <lukeshu@lukeshu.com>2018-04-18 16:28:37 -0400
commit3b6279ddf21ca58b8cf9469c04a249d69ea449cb (patch)
treedbbe3febfc4d4aa889fee787d4d934b9f4720d07 /ping.go
parent45717808e4c8861e022e838aacb8215c81dcd327 (diff)
add comments, fiddle with function publicity
Diffstat (limited to 'ping.go')
-rw-r--r--ping.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/ping.go b/ping.go
index a41b4ab..ba825e8 100644
--- a/ping.go
+++ b/ping.go
@@ -7,6 +7,9 @@ import (
"strings"
)
+// Ping sends one ICMP echo packet to the given IP and times how long
+// it takes to get a response, in milleseconds. Returns -1 if no
+// response is received.
func Ping(ip net.IP) float64 {
cmd := exec.Command("ping",
"-n", // numeric