elapsed added
This commit is contained in:
parent
2339fcd264
commit
e1bcbd13cd
13
benchmark/elapsed.go
Normal file
13
benchmark/elapsed.go
Normal file
|
@ -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))
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user