awesome-patterns/profiling/profile.go
2019-10-30 03:46:27 +08:00

13 lines
188 B
Go

package profile
import (
"time"
"log"
)
func Duration(invocation time.Time, name string) {
elapsed := time.Since(invocation)
log.Printf("%s lasted %s", name, elapsed)
}