Create profile.go

This commit is contained in:
YikesHome 2019-10-30 03:46:27 +08:00 committed by GitHub
parent f978e42036
commit bd27cda490
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

12
profiling/profile.go Normal file
View 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)
}