aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRasmus Dahlberg <rasmus@rgdd.se>2023-04-02 15:15:16 +0200
committerRasmus Dahlberg <rasmus@rgdd.se>2023-04-02 15:15:16 +0200
commit5422dbde1e07f341515fa9b70ee5e1a25c200418 (patch)
tree8dd2a7c870b00ce6ca0187a2fae0871e1d9c434a
parenteb2e58baeb7984b34e77efcb3a1b499eff186ad4 (diff)
Move measurement duration print
-rw-r--r--main.go12
1 files 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)