Categorygithub.com/kevwan/gobench
repositorypackage
0.0.0-20231020153451-db90efe43b2b
Repository: https://github.com/kevwan/gobench.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# README

gobench

Write and plot your benchmark just in Go.

How to use

package main

import (
	"math/rand"
	"time"

	"github.com/kevwan/gobench"
)

func main() {
	b := gobench.NewBench()
	b.Run(10000, func() {
		n := rand.Intn(100)
		time.Sleep(time.Millisecond * time.Duration(n))
	})
}

After running a period, you can Ctrl+C to stop the benchmark and it will automatically open your browser and show the benchmark result like below:

image

Give a Star! ⭐

If you like or are using this project to learn or start your solution, please give it a star. Thanks!