From e1bcbd13cd3690ea79ac9a131de4c53f21039c08 Mon Sep 17 00:00:00 2001 From: crusader Date: Sat, 1 Sep 2018 12:12:54 +0900 Subject: [PATCH] elapsed added --- benchmark/elapsed.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 benchmark/elapsed.go 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)) + } +}