13 lines
161 B
Go
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)
|
|
}
|
|
}
|