Browse Source

Add a test utility for timing the duration of things easily

pull/184/head
Gabe Kangas 5 years ago
parent
commit
0ac9ea7f57
  1. 19
      test/durationTimerTest.go

19
test/durationTimerTest.go

@ -0,0 +1,19 @@ @@ -0,0 +1,19 @@
package test
import (
"time"
log "github.com/sirupsen/logrus"
)
var timestamp time.Time
func Mark() {
now := time.Now()
if !timestamp.IsZero() {
delta := now.Sub(timestamp)
log.Println(delta.Milliseconds(), "ms")
}
timestamp = now
}
Loading…
Cancel
Save