add bench to makefile

This commit is contained in:
2024-12-01 21:14:30 +00:00
parent 1ea679ebe3
commit 475ccfe0ba
3 changed files with 19 additions and 4 deletions

View File

@@ -8,7 +8,7 @@ EXE := $(BIN_DIR)/$(program)
.DEFAULT_GOAL := build
.PHONY: fmt vet build clean
.PHONY: fmt vet build bench clean
fmt:
$(GO) fmt ./...
@@ -18,6 +18,9 @@ vet: fmt
build: vet | $(BIN_DIR)
$(GO) build -o $(EXE) .
bench:
$(GO) test . -test.count=10 -bench=. > benchmark
$(BIN_DIR):
@mkdir -p $@