Skip to content

Commit dad4104

Browse files
committed
fix #8 added elapsed time to the output
1 parent 20a0658 commit dad4104

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

main.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,13 +140,15 @@ func main() {
140140
opt.Option = append(opt.Option, newEDNS0Padding(req))
141141
}
142142

143+
startTime := time.Now()
143144
reply, err := u.Exchange(req)
144145
if err != nil {
145146
log.Fatalf("Cannot make the DNS request: %s", err)
146147
}
147148

148149
if !machineReadable {
149-
os.Stdout.WriteString("dnslookup result:\n")
150+
msg := fmt.Sprintf("dnslookup result (elapsed %v):\n", time.Now().Sub(startTime))
151+
os.Stdout.WriteString(msg)
150152
os.Stdout.WriteString(reply.String() + "\n")
151153
} else {
152154
var b []byte

0 commit comments

Comments
 (0)