Documentation
¶
Overview ¶
Package humanize provides human-readable representations of numbers, bytes, durations, speed (units/sec), etc.
Index ¶
Constants ¶
const EraseToEndOfLine = "\033[K"
EraseToEndOfLine is the ANSI control sequence to erase the current line from the cursor to the end.
Variables ¶
This section is empty.
Functions ¶
func Bytes ¶
func Bytes[T ~int64 | ~uint64 | ~int | ~uint | ~int32 | ~uint32 | ~int16 | ~uint16 | ~int8 | ~uint8 | ~uintptr](numAny T) string
Bytes returns the rendering of bytes aproximated to the nearest power of 1024 (Kb, Mb, Gb, Tb, etc.) with one decimal place.
func Count ¶
func Count[T ~int64 | ~uint64 | ~int | ~uint | ~int32 | ~uint32 | ~int16 | ~uint16 | ~int8 | ~uint8 | ~uintptr](numT T) string
Count returns a compact string representation of an integer count appending powers of 1000 suffixes (K, M, G, T, P, E).
func DurationPerOp ¶ added in v0.1.9
DurationPerOp returns the duration per operation split into a float value and unit string (e.g. 12.3 and "µs/op"), suitable for reporting metrics in benchmarks via b.ReportMetric(humanize.DurationPerOp(elapsed, b.N)).
Types ¶
This section is empty.