perf

package
v0.0.0-...-43c2f11 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2024 License: PostgreSQL Imports: 7 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatBytes

func FormatBytes(value int) string
Example
package main

import (
	"fmt"

	"github.com/dalibo/ldap2pg/internal/perf"
)

func main() {
	var value int
	value = 5546875
	fmt.Printf("%dB = %s\n", value, perf.FormatBytes(value))
	value = 4
	fmt.Printf("%dB = %s\n", value, perf.FormatBytes(value))
	value = 900
	fmt.Printf("%dB = %s\n", value, perf.FormatBytes(value))
}
Output:

5546875B = 5.3MiB
4B = 4B
900B = 0.9KiB

func ReadVMPeak

func ReadVMPeak() int

Types

type StopWatch

type StopWatch struct {
	Count int
	Total time.Duration
}

func (*StopWatch) TimeIt

func (t *StopWatch) TimeIt(fn Timeable) (duration time.Duration)

type Timeable

type Timeable func()

Jump to

Keyboard shortcuts

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