mirror of
https://github.com/crazybber/awesome-patterns.git
synced 2024-11-25 22:36:05 +03:00
Create profile.go
This commit is contained in:
parent
f978e42036
commit
bd27cda490
12
profiling/profile.go
Normal file
12
profiling/profile.go
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
package profile
|
||||||
|
|
||||||
|
import (
|
||||||
|
"time"
|
||||||
|
"log"
|
||||||
|
)
|
||||||
|
|
||||||
|
func Duration(invocation time.Time, name string) {
|
||||||
|
elapsed := time.Since(invocation)
|
||||||
|
|
||||||
|
log.Printf("%s lasted %s", name, elapsed)
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user