Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Timer ¶
type Timer struct {
Name string
StageTimes map[string]time.Time
StageDurations map[string]time.Duration
StagePercentages map[string]string
Total int64
AlignKeys bool
Enabled bool
// contains filtered or unexported fields
}
Timer is a simple timer that can be used to time the duration of program stages.
func NewTimer ¶
NewTimer creates a new Timer with the given name. If align is true, values will be vertially aligned in the JSON output
func (*Timer) Mark ¶
Mark records the current time as the end of a stage. e.g. to time a block of code: t = NewTimer("MyTimer"); SomeCode(); t.Mark("Some Code");
Click to show internal directories.
Click to hide internal directories.