From 5422dbde1e07f341515fa9b70ee5e1a25c200418 Mon Sep 17 00:00:00 2001 From: Rasmus Dahlberg Date: Sun, 2 Apr 2023 15:15:16 +0200 Subject: Move measurement duration print --- main.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/main.go b/main.go index 830af03..ed1d2dd 100644 --- a/main.go +++ b/main.go @@ -21,6 +21,12 @@ import ( ) func main() { + start := time.Now().Round(time.Second) + defer func() { + end := time.Now().Round(time.Second) + log.Printf("INFO: measurement duration was %v\n", end.Sub(start)) + }() + opts := options.Parse() cli := &http.Client{ Transport: &http.Transport{ @@ -48,12 +54,6 @@ func main() { ctx, cancel := context.WithCancel(bg) defer cancel() - start := time.Now().Round(time.Second) - defer func() { - end := time.Now().Round(time.Second) - log.Printf("INFO: measurement duration was %v\n", end.Sub(start)) - }() - log.Printf("INFO: ctrl+C to exit prematurely\n") go func() { wg.Add(1) -- cgit v1.2.3