util-go/benchmark/elapsed.go
2018-09-01 12:12:54 +09:00

14 lines
172 B
Go

package benchmark
import (
"fmt"
"time"
)
func Elapsed(what string) func() {
start := time.Now()
return func() {
fmt.Printf("%s: %v", what, time.Since(start))
}
}