add bench tool

This commit is contained in:
Dustin Stiles 2025-03-09 16:14:19 -04:00
parent 2d3631af45
commit d75d432818
2 changed files with 21 additions and 3 deletions

View File

@ -1,7 +1,7 @@
goos: linux goos: linux
goarch: amd64 goarch: amd64
pkg: koti.casa/numenor-labs/dsfx/shared/dnet pkg: koti.casa/numenor-labs/dsfx/pkg/handshake
cpu: Intel(R) Core(TM) Ultra 9 185H cpu: Intel(R) Core(TM) Ultra 9 185H
BenchmarkHandshake-22 537 2179739 ns/op BenchmarkHandshake-22 530 2233341 ns/op
PASS PASS
ok koti.casa/numenor-labs/dsfx/shared/dnet 1.182s ok koti.casa/numenor-labs/dsfx/pkg/handshake 1.192s

18
tool/bench/main.go Normal file
View File

@ -0,0 +1,18 @@
package main
import (
"fmt"
"os"
"os/exec"
)
func main() {
cmd := exec.Command("go", "test", "-bench=Handshake", "./pkg/handshake/...")
output, err := cmd.Output()
if err != nil {
panic(err)
}
fmt.Fprint(os.Stdout, string(output))
}