MCPcopy Create free account
hub / github.com/ddev/ddev / timeTrack

Function timeTrack

pkg/util/debug.go:72–81  ·  view source on GitHub ↗

timeTrack is the internal helper for the exported time track functions.

(name *string)

Source from the content-addressed store, hash-verified

70
71// timeTrack is the internal helper for the exported time track functions.
72func 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.

Callers 2

TimeTrackFunction · 0.85
TimeTrackCFunction · 0.85

Calls 1

FormatMethod · 0.80

Tested by

no test coverage detected