This commit is contained in:
crusader 2018-09-03 22:57:13 +09:00
parent e1bcbd13cd
commit fae2846a85

View File

@ -1,13 +1,12 @@
package benchmark package benchmark
import ( import (
"fmt"
"time" "time"
) )
func Elapsed(what string) func() { func Elapsed() func() time.Duration {
start := time.Now() start := time.Now()
return func() { return func() time.Duration {
fmt.Printf("%s: %v", what, time.Since(start)) return time.Since(start)
} }
} }