utils

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 28, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartCPUProfile

func StartCPUProfile() func()

You can view the cpu profile file with `go tool pprof codetalks-cpu.prof` or visualize it on website like https://www.speedscope.app/

func StartMemoryProfile

func StartMemoryProfile() func()

You can view the memory profile file with `go tool pprof codetalks-mem.prof` or visualize it on website like https://www.speedscope.app/

func StartTrace

func StartTrace() func()

You can view the trace file with `go tool trace codetalks-trace.prof`

func TimeIt

func TimeIt(fn func())

Types

type Set

type Set struct {
	// contains filtered or unexported fields
}

Define a set as a map with keys of type string and values of type void

func NewSet

func NewSet() *Set

Helper function to create a new set

func (*Set) Add

func (s *Set) Add(item string)

Helper function to add an item to the set

func (*Set) Contains

func (s *Set) Contains(item string) bool

Helper function to check if an item is in the set

func (*Set) Remove

func (s *Set) Remove(item string)

Helper function to remove an item from the set

Jump to

Keyboard shortcuts

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