mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 20:34:37 +03:00
Initial commit
This commit is contained in:
19
vendor/github.com/markbates/oncer/log_debug.go
generated
vendored
Normal file
19
vendor/github.com/markbates/oncer/log_debug.go
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
//+build debug
|
||||
|
||||
package oncer
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
)
|
||||
|
||||
func log(name string, fn func()) func() {
|
||||
return func() {
|
||||
start := time.Now()
|
||||
if len(name) > 80 {
|
||||
name = name[(len(name) - 80):]
|
||||
}
|
||||
defer fmt.Println(name, time.Now().Sub(start))
|
||||
fn()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user