Skip to content

Commit bd27cda

Browse files
authored
Create profile.go
1 parent f978e42 commit bd27cda

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

profiling/profile.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package profile
2+
3+
import (
4+
"time"
5+
"log"
6+
)
7+
8+
func Duration(invocation time.Time, name string) {
9+
elapsed := time.Since(invocation)
10+
11+
log.Printf("%s lasted %s", name, elapsed)
12+
}

0 commit comments

Comments
 (0)