aboutsummaryrefslogtreecommitdiff
path: root/tests/benchmarks/int64-add64
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2025-01-23 09:54:11 -0300
committerEuAndreh <eu@euandre.org>2025-01-23 11:36:44 -0300
commit5f6607152a96b85f1518028b8f1ee1ef1aefda75 (patch)
treebe54946ddb2510a317322a2660563c83cab2117c /tests/benchmarks/int64-add64
parenttests/stm.go: Turn example into functional test (diff)
downloadstm-5f6607152a96b85f1518028b8f1ee1ef1aefda75.tar.gz
stm-5f6607152a96b85f1518028b8f1ee1ef1aefda75.tar.xz
Move benchmarks from tests/stm.go to tests/benchmarks/*
Diffstat (limited to 'tests/benchmarks/int64-add64')
l---------tests/benchmarks/int64-add64/main.go1
-rw-r--r--tests/benchmarks/int64-add64/stm.go23
2 files changed, 24 insertions, 0 deletions
diff --git a/tests/benchmarks/int64-add64/main.go b/tests/benchmarks/int64-add64/main.go
new file mode 120000
index 0000000..f67563d
--- /dev/null
+++ b/tests/benchmarks/int64-add64/main.go
@@ -0,0 +1 @@
+../../main.go \ No newline at end of file
diff --git a/tests/benchmarks/int64-add64/stm.go b/tests/benchmarks/int64-add64/stm.go
new file mode 100644
index 0000000..8e225c9
--- /dev/null
+++ b/tests/benchmarks/int64-add64/stm.go
@@ -0,0 +1,23 @@
+package stm
+
+import (
+ "flag"
+)
+
+
+
+var nFlag = flag.Int(
+ "n",
+ 1_000,
+ "The number of iterations to execute",
+)
+
+func MainTest() {
+ flag.Parse()
+ n := *nFlag
+
+ v := NewInt64(0)
+ for i := 0; i < n; i++ {
+ v.Add(1)
+ }
+}