MCPcopy
hub / github.com/pterm/pterm / parseElapsedTime

Method parseElapsedTime

progressbar_printer.go:352–361  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

350}
351
352func (p *ProgressbarPrinter) parseElapsedTime() string {
353 // time.Duration.Round panics if the rounding factor is <= 0.
354 // Guard against invalid values by skipping rounding in this case.
355 if p.ElapsedTimeRoundingFactor <= 0 {
356 return p.GetElapsedTime().String()
357 }
358
359 s := p.GetElapsedTime().Round(p.ElapsedTimeRoundingFactor).String()
360 return s
361}

Callers 1

getStringMethod · 0.95

Calls 2

GetElapsedTimeMethod · 0.95
StringMethod · 0.45

Tested by

no test coverage detected