awesome-patterns/profiling/profile.go

13 lines
188 B
Go
Raw Normal View History

2019-10-29 22:46:27 +03:00
package profile
import (
"time"
"log"
)
func Duration(invocation time.Time, name string) {
elapsed := time.Since(invocation)
log.Printf("%s lasted %s", name, elapsed)
}