0

Add a test utility for timing the duration of things easily

This commit is contained in:
Gabe Kangas 2020-09-22 14:10:01 -07:00
parent 17ef8eed0d
commit 0ac9ea7f57

19
test/durationTimerTest.go Normal file
View File

@ -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
}