prettybenchmarks

package
v0.0.0-...-b2ec4e5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package prettybenchmarks formats your go benchmarks into nice looking sorted tables

Prettybenchmarks

Works with and without -benchmem flag

If you provide a time interval (either ns, µs (or us), ms, s), each benchmark's runtime will be converted to that interval. If left blank, a suitable value will automatically be chosen

go test -bench=YOUR_PKG [-benchmem] | pb [timeinterval]

Example

go test -bench=. -benchmem | pb ms

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Main

func Main()

Main is the entry point to parse benchmarks not intended for use in libraries, but has to be exported to ensure the tool can be called via 'pb'

func RenderFloat

func RenderFloat(format string, n float64) string

RenderFloat formats a given integer n according to the provided format Examples of format strings for given n = 12345.6789:

"#,###.##" => "12,345.67"
"#,###." => "12,345"
"#,###" => "12345,678"
"#\u202F###,##" => "12 345,67"
"#.###,###### => 12.345,678900
"" (aka default format) => 12,345.67

Author: https://github.com/gorhill, Source: https://gist.github.com/gorhill/5285193

func RenderInteger

func RenderInteger(format string, n int) string

RenderInteger formats a given integer n according to the provided format Examples of format strings for given n = 12345:

"#,###.##" => "12,345.00"
"#,###." => "12,345"
"#,###" => "12345,000"
"#\u202F###,##" => "12 345,00"
"#.###,###### => 12.345,000000
"" (aka default format) => 12,345.00

Author: https://github.com/gorhill, Source: https://gist.github.com/gorhill/5285193

func StringsContains

func StringsContains(elements []string, needle string) bool

StringsContains checks if a string slice contains search element

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL