Documentation
¶
Overview ¶
Example ¶
someLogger := log.New(io.Discard, "[TIMING]", 0)
f := func() {
defer Track("MyFunc", time.Now(), someLogger)
// Do stuff here
}
f()
// someLogger will have the timing for the function
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Now ¶
Now is equivalent to time.Now(), but saves the import of "time" if it's not otherwise needed
func Track ¶
Track tracks how long a function takes, to a log.Logger e.g. make the first line defer Track("func_name", time.Now(), logger).
Types ¶
Click to show internal directories.
Click to hide internal directories.