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
import (
"fmt"
"time"
)
func Elapsed(what string) func() {
func Elapsed() func() time.Duration {
start := time.Now()
return func() {
fmt.Printf("%s: %v", what, time.Since(start))
return func() time.Duration {
return time.Since(start)
}
}