util-go/benchmark/elapsed.go
crusader fae2846a85 ing
2018-09-03 22:57:13 +09:00

13 lines
161 B
Go

package benchmark
import (
"time"
)
func Elapsed() func() time.Duration {
start := time.Now()
return func() time.Duration {
return time.Since(start)
}
}