()
| 34 | } |
| 35 | |
| 36 | func FunctionTimer() *timer { |
| 37 | if !timerEnabled { |
| 38 | return nil |
| 39 | } |
| 40 | pc := make([]uintptr, 15) |
| 41 | n := runtime.Callers(2, pc) |
| 42 | frames := runtime.CallersFrames(pc[:n]) |
| 43 | frame, _ := frames.Next() |
| 44 | parts := strings.Split(frame.Function, ".") |
| 45 | return Timer(parts[len(parts)-1]) |
| 46 | } |
| 47 | |
| 48 | func (t *timer) End() { |
| 49 | if t == nil { |
no test coverage detected