14 lines
172 B
Go
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))
|
||
|
}
|
||
|
}
|