ing
This commit is contained in:
parent
e1bcbd13cd
commit
fae2846a85
|
@ -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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user