Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Stdout is a log.Logger that outputs formatted messages to os.Stdout, for convenience. Stdout = log.New(os.Stdout, "[TIMING]", log.Lshortfile) // Stderr is a log.Logger that outputs formattedd messages to os.Stderr, for convenience. Stderr = log.New(os.Stderr, "[TIMING]", log.Lshortfile) )
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).
func TrackErr ¶
TrackErr tracks how long a function takes, to Stderr e.g. make the first line: defer Trackerr("func_name", time.Now()).
func TrackIfLate ¶ added in v1.1.0
TrackIfLate is the same as Track(..), but only prints if the elapsed time is greater than specified.
Types ¶
Click to show internal directories.
Click to hide internal directories.