15 lines
241 B
Go
Raw Normal View History

package utils
import (
"time"
"go.uber.org/zap"
)
2023-03-23 19:45:15 +05:30
func Elapsed(funcName string, args ...interface{}) func() {
start := time.Now()
return func() {
2023-03-23 19:45:15 +05:30
zap.S().Infof("func %s took %v with args %v", funcName, time.Since(start), args)
}
}