Documentation ¶
Index ¶
- func After(n int, suffix string) <-chan time.Time
- func Now() func() T
- func Trunc(d time.Duration, digits int) string
- type B
- func (b *B) Add(t T, value ...float64)
- func (b B) Avg() (t time.Duration, k float64)
- func (b B) Avgk() float64
- func (b B) Avgt() time.Duration
- func (b B) Cap() int
- func (b B) Format(state fmt.State, verb rune)
- func (b B) Len() int
- func (b B) Ordered() []T
- func (b B) Std() (t time.Duration, k float64)
- func (b B) Stdk() float64
- func (b B) Stdt() time.Duration
- func (b B) Unordered() []T
- type T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func After ¶ added in v0.7.7
After is a convenient wrapper for time.After
Types ¶
type B ¶
type B struct {
// contains filtered or unexported fields
}
B is a benchmark ring.
Non-zero length B's function as a ring, effectively rewriting old frames with the new ones. Zero length B's grow normally.
func (*B) Add ¶ added in v0.7.7
Adds pushes a time frame to the benchmark ring.
func (B) Avg ¶ added in v0.7.7
Avg corresponds to the arithmetic average.
func (B) Avgk ¶ added in v0.7.7
Avgk returns the average of stored values in the ring.
func (B) Avgt ¶ added in v0.7.7
Avgt returns the average duration of all measurements.
func (B) Len ¶ added in v0.7.7
Len is the number of items in the underlying slice.
func (B) Ordered ¶ added in v0.7.7
Ordered returns the list of frames adjusted for ring position.
func (B) Std ¶ added in v0.7.7
Std corresponds to the standard deviation.
func (B) Stdk ¶ added in v0.7.7
Avgt returns the standard deviation of the K-values.
func (B) Stdt ¶ added in v0.7.7
Avgt returns the standard deviation of the durations.