TimeTrackC determines the amount of time a function takes to return. Timer starts when it is called. The customName parameter is printed. It returns an anonymous function that, when called, will print the elapsed run time. It only tracks if DDEV_VERBOSE is set. Usage: defer util.TimeTrackC("a cu
(customName string)
| 61 | // ... |
| 62 | // tracker() |
| 63 | func TimeTrackC(customName string) func() { |
| 64 | if globalconfig.DdevVerbose { |
| 65 | return timeTrack(&customName) |
| 66 | } |
| 67 | |
| 68 | return func() {} |
| 69 | } |
| 70 | |
| 71 | // timeTrack is the internal helper for the exported time track functions. |
| 72 | func timeTrack(name *string) func() { |