diff options
author | Rasmus Dahlberg <rasmus@rgdd.se> | 2023-04-02 15:15:16 +0200 |
---|---|---|
committer | Rasmus Dahlberg <rasmus@rgdd.se> | 2023-04-02 15:15:16 +0200 |
commit | 5422dbde1e07f341515fa9b70ee5e1a25c200418 (patch) | |
tree | 8dd2a7c870b00ce6ca0187a2fae0871e1d9c434a | |
parent | eb2e58baeb7984b34e77efcb3a1b499eff186ad4 (diff) |
Move measurement duration print
-rw-r--r-- | main.go | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -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) |