var Timer … type Timings … type timestamp … type event … func (t *Timings) append(labels []string, start bool) { … } // Start marks the beginning of a new phase and implicitly stops the previous phase. // The phase name is the colon-separated concatenation of the labels. func (t *Timings) Start(labels ...string) { … } // Stop marks the end of a phase and implicitly starts a new phase. // The labels are added to the labels of the ended phase. func (t *Timings) Stop(labels ...string) { … } // AddEvent associates an event, i.e., a count, or an amount of data, // with the most recently started or stopped phase; or the very first // phase if Start or Stop hasn't been called yet. The unit specifies // the unit of measurement (e.g., MB, lines, no. of funcs, etc.). func (t *Timings) AddEvent(size int64, unit string) { … } // Write prints the phase times to w. // The prefix is printed at the start of each line. func (t *Timings) Write(w io.Writer, prefix string) { … } func commonPrefix(a, b string) string { … } type lines … func (lines *lines) add(label string, n int, dt, tot time.Duration, events []*event) { … } func (lines lines) write(w io.Writer) { … } func isnumber(s string) bool { … }