mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-06-04 11:25:52 +08:00
15 lines
241 B
Go
15 lines
241 B
Go
package utils
|
|
|
|
import (
|
|
"time"
|
|
|
|
"go.uber.org/zap"
|
|
)
|
|
|
|
func Elapsed(funcName string, args ...interface{}) func() {
|
|
start := time.Now()
|
|
return func() {
|
|
zap.S().Infof("func %s took %v with args %v", funcName, time.Since(start), args)
|
|
}
|
|
}
|