diff --git a/benchmark/elapsed.go b/benchmark/elapsed.go new file mode 100644 index 0000000..15d955a --- /dev/null +++ b/benchmark/elapsed.go @@ -0,0 +1,13 @@ +package benchmark + +import ( + "fmt" + "time" +) + +func Elapsed(what string) func() { + start := time.Now() + return func() { + fmt.Printf("%s: %v", what, time.Since(start)) + } +}