Fill README section about performance

This commit is contained in:
golangci 2018-05-19 22:09:20 +03:00
parent 3c2ca7b7c9
commit ab0ce75c06
8 changed files with 157 additions and 63 deletions

View file

@ -61,7 +61,11 @@ func (s *Stopwatch) Print() {
}
func (s *Stopwatch) PrintStages() {
logrus.Infof("%s %s", s.name, s.sprintStages())
var stagesDuration time.Duration
for _, s := range s.stages {
stagesDuration += s
}
logrus.Infof("%s took %s with %s", s.name, stagesDuration, s.sprintStages())
}
func (s *Stopwatch) TrackStage(name string, f func()) {