Documentation ¶
Index ¶
Constants ¶
const (
// TotalTimeElapsed is a constant string value to denote total time elapsed.
TotalTimeElapsed = "Total"
)
Variables ¶
This section is empty.
Functions ¶
func LogSummary ¶
func LogSummary()
LogSummary prints the summary of all the times collected so far into the INFO section.
func StartTimer ¶
func StartTimer(key string)
StartTimer initiailzes the timer object with the current timestamp information.
Types ¶
type Timer ¶
type Timer struct {
// contains filtered or unexported fields
}
Timer is the struct that keeps track of each of the sections.
func NewTimer ¶
func NewTimer() Timer
NewTimer returns a new timer that can be used to track sections and
func (*Timer) LogSummary ¶
LogSummary prints the summary of all the times collected so far into the INFO section. The format of printing will be the following: If there are no stages except the total time stage, then it only prints the following Time elapsed: <x>m<yy>s If there are multiple stages, it prints the following: Time elapsed for each section Stage1: <x>m<yy>s Stage2: <x>m<yy>s . . . StageN: <x>m<yy>s Time elapsed: <x>m<yy>s All durations printed are rounded up to the next second value and printed in the format mentioned above.
func (*Timer) StartTimer ¶
StartTimer initializes the timer object with the current timestamp information.