MCPcopy Index your code
hub / github.com/ddev/ddev / TimeTrackC

Function TimeTrackC

pkg/util/debug.go:63–69  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

61// ...
62// tracker()
63func 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.
72func timeTrack(name *string) func() {

Callers 15

TestPHPOverridesFunction · 0.92
TestExtraPackagesFunction · 0.92
TestTimezoneConfigFunction · 0.92
TestProcessHooksFunction · 0.92
TestDdevStartFunction · 0.92
TestDdevNoProjectMountFunction · 0.92
TestDdevXdebugEnabledFunction · 0.92

Calls 1

timeTrackFunction · 0.85

Tested by 15

TestPHPOverridesFunction · 0.74
TestExtraPackagesFunction · 0.74
TestTimezoneConfigFunction · 0.74
TestProcessHooksFunction · 0.74
TestDdevStartFunction · 0.74
TestDdevNoProjectMountFunction · 0.74
TestDdevXdebugEnabledFunction · 0.74