From cacbb11b7cb9523f447a78382b8751f5885c8001 Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Sun, 1 Dec 2024 18:25:08 +0000 Subject: [PATCH] add benchmark --- day-01/benchmark | 6 ++++++ day-01/main_internal_test.go | 11 +++++++++++ 2 files changed, 17 insertions(+) create mode 100644 day-01/benchmark create mode 100644 day-01/main_internal_test.go diff --git a/day-01/benchmark b/day-01/benchmark new file mode 100644 index 0000000..424ca50 --- /dev/null +++ b/day-01/benchmark @@ -0,0 +1,6 @@ +goos: linux +goarch: amd64 +pkg: github.com/onyx-and-iris/aoc2024/day-01 +cpu: Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz +BenchmarkMain-12 1000000000 0.001628 ns/op +ok github.com/onyx-and-iris/aoc2024/day-01 0.015s diff --git a/day-01/main_internal_test.go b/day-01/main_internal_test.go new file mode 100644 index 0000000..ae4aa6b --- /dev/null +++ b/day-01/main_internal_test.go @@ -0,0 +1,11 @@ +package main + +import ( + "os" + "testing" +) + +func BenchmarkMain(b *testing.B) { + os.Stdout, _ = os.Open(os.DevNull) + main() +}