timeTrack is the internal helper for the exported time track functions.
(name *string)
| 70 | |
| 71 | // timeTrack is the internal helper for the exported time track functions. |
| 72 | func timeTrack(name *string) func() { |
| 73 | start := time.Now() |
| 74 | |
| 75 | // Print message and return func. Printf is avoided to minimize impact. |
| 76 | output.UserOut.Print("PERF: enter " + *name + " at " + start.Format("15:04:05.000000000")) |
| 77 | |
| 78 | return func() { |
| 79 | output.UserOut.Print("PERF: exit " + *name + " at " + time.Now().Format("15:04:05.000000000") + " after " + strconv.FormatInt(time.Since(start).Milliseconds(), 10) + "ms") |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | // CheckGoroutines updates the number of goroutines |
| 84 | // and optionally outputs the list of them on verbose. |
no test coverage detected