feat: add go-bench command

This commit is contained in:
Kim, Jimin 2024-05-04 19:00:22 +09:00
parent 26f146a39c
commit 15479c4978
Signed by: pomp
GPG key ID: D3932F82A0667A3B
2 changed files with 18 additions and 0 deletions

View file

@ -6,3 +6,6 @@
@bench-go: build-go
hyperfine './go/a < ./input.txt'
@go-bench:
cd go && go test -bench=.

15
go/main_test.go Normal file
View file

@ -0,0 +1,15 @@
package main
import (
"testing"
)
const N int = 100_000_000
var num int = 10
func BenchmarkAdd1(b *testing.B) {
for i := 0; i < N; i++ {
_ = num * num
}
}